提交 e60e5038 编写于 作者: G George Kulakowski

Add fnl build configuration

上级 bf44514f
......@@ -22,7 +22,7 @@
#if defined(__GLIBCXX__)
#include <cxxabi.h>
#endif
#if !defined(__UCLIBC__)
#if !defined(__UCLIBC__) && !defined(FNL_MUSL)
#include <execinfo.h>
#endif
......@@ -738,7 +738,7 @@ StackTrace::StackTrace() {
// NOTE: This code MUST be async-signal safe (it's used by in-process
// stack dumping signal handler). NO malloc or stdio is allowed here.
#if !defined(__UCLIBC__)
#if !defined(__UCLIBC__) && !defined(FNL_MUSL)
// Though the backtrace API man page does not list any possible negative
// return values, we take no chance.
count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
......
......@@ -12,7 +12,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/errno.h>
#include <sys/mman.h>
#include <sys/param.h>
#include <sys/stat.h>
......
......@@ -59,7 +59,7 @@ source_set("trace_event") {
]
}
if (is_linux || is_android) {
if ((is_linux || is_android) && !is_fnl) {
sources += [
"malloc_dump_provider.cc",
"malloc_dump_provider.h",
......
......@@ -116,7 +116,7 @@ void MemoryDumpManager::Initialize() {
RegisterDumpProvider(ProcessMemoryTotalsDumpProvider::GetInstance());
#endif
#if defined(OS_LINUX) || defined(OS_ANDROID)
#if (defined(OS_LINUX) && !defined(FNL_MUSL)) || defined(OS_ANDROID)
g_mmaps_dump_provider = ProcessMemoryMapsDumpProvider::GetInstance();
RegisterDumpProvider(g_mmaps_dump_provider);
RegisterDumpProvider(MallocDumpProvider::GetInstance());
......
......@@ -272,6 +272,9 @@ config("feature_flags") {
if (enable_webvr) {
defines += [ "ENABLE_WEBVR" ]
}
if (is_fnl) {
defines += [ "HAVE_SYS_QUEUE_H_=0" ]
}
}
# Debug/release ----------------------------------------------------------------
......
......@@ -176,6 +176,7 @@ declare_args() {
if (current_os == "win") {
is_android = false
is_chromeos = false
is_fnl = false
is_ios = false
is_linux = false
is_mac = false
......@@ -185,6 +186,7 @@ if (current_os == "win") {
} else if (current_os == "mac") {
is_android = false
is_chromeos = false
is_fnl = false
is_ios = false
is_linux = false
is_mac = true
......@@ -194,6 +196,7 @@ if (current_os == "win") {
} else if (current_os == "android") {
is_android = true
is_chromeos = false
is_fnl = false
is_ios = false
is_linux = false
is_mac = false
......@@ -203,6 +206,7 @@ if (current_os == "win") {
} else if (current_os == "chromeos") {
is_android = false
is_chromeos = true
is_fnl = false
is_ios = false
is_linux = true
is_mac = false
......@@ -215,6 +219,7 @@ if (current_os == "win") {
# Posix variant.
is_android = false
is_chromeos = false
is_fnl = false
is_ios = false
is_linux = false
is_mac = false
......@@ -224,6 +229,7 @@ if (current_os == "win") {
} else if (current_os == "ios") {
is_android = false
is_chromeos = false
is_fnl = false
is_ios = true
is_linux = false
is_mac = false
......@@ -233,6 +239,17 @@ if (current_os == "win") {
} else if (current_os == "linux") {
is_android = false
is_chromeos = false
is_fnl = false
is_ios = false
is_linux = true
is_mac = false
is_nacl = false
is_posix = true
is_win = false
} else if (current_os == "fnl") {
is_android = false
is_chromeos = false
is_fnl = true
is_ios = false
is_linux = true
is_mac = false
......@@ -400,7 +417,9 @@ if (is_posix) {
]
}
if (is_linux) {
if (is_fnl) {
_native_compiler_configs += [ "//build/config/fnl:sdk" ]
} else if (is_linux) {
_native_compiler_configs += [ "//build/config/linux:sdk" ]
} else if (is_mac) {
_native_compiler_configs += [ "//build/config/mac:sdk" ]
......@@ -574,6 +593,9 @@ if (is_win) {
if (is_chromeos && cros_use_custom_toolchain) {
set_default_toolchain("//build/toolchain/cros:target")
}
if (is_fnl) {
set_default_toolchain("//build/toolchain/fnl:target")
}
} else if (is_mac) {
host_toolchain = "//build/toolchain/mac:clang_x64"
set_default_toolchain(host_toolchain)
......
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/linux/pkg_config.gni")
import("//build/config/features.gni")
import("//build/config/sysroot.gni")
import("//build/config/ui.gni")
config("sdk") {
if (sysroot != "") {
cflags = [ "--sysroot=" + sysroot ]
ldflags = [ "--sysroot=" + sysroot ]
# Need to get some linker flags out of the sysroot.
ldflags += [ exec_script("../linux/sysroot_ld_path.py",
[
rebase_path("//build/linux/sysroot_ld_path.sh",
root_build_dir),
sysroot,
],
"value") ]
}
defines = [ "FNL_MUSL" ]
if (use_ozone) {
defines += [ "MESA_EGL_NO_X11_HEADERS" ]
}
}
config("fontconfig") {
libs = [ "fontconfig" ]
}
pkg_config("freetype2") {
packages = [ "freetype2" ]
}
if (use_evdev_gestures) {
pkg_config("libevdev-cros") {
packages = [ "libevdev-cros" ]
}
pkg_config("libgestures") {
packages = [ "libgestures" ]
}
}
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/toolchain/gcc_toolchain.gni")
declare_args() {
toolchain_prefix = ""
}
gcc_toolchain("target") {
assert(toolchain_prefix != "", "Must provide toolchain_prefix")
cc = "${toolchain_prefix}gcc"
cxx = "${toolchain_prefix}g++"
ar = "${toolchain_prefix}ar"
ld = cxx
readelf = "${toolchain_prefix}readelf"
nm = "${toolchain_prefix}nm"
toolchain_cpu = "${target_cpu}"
toolchain_os = "linux"
is_clang = is_clang
}
......@@ -18,6 +18,10 @@ group("sky") {
deps += [ "//sky/tools/sky_snapshot($dart_host_toolchain)" ]
}
if (is_fnl) {
deps -= [ "//sky/shell" ]
}
if (is_linux || is_android) {
deps += [ "//sky/shell/platform/mojo" ]
}
......
......@@ -24,7 +24,15 @@ copy("sky_shell") {
deps = [
"//sky/shell:shell_struct",
]
} else if(!is_ios) {
} else if (is_fnl) {
sources = [
"$root_build_dir/flutter.mojo",
]
deps = [
"//sky/shell/platform/mojo",
]
} else if (!is_ios) {
sources = [
"$root_build_dir/flutter.mojo",
"$root_build_dir/icudtl.dat",
......
......@@ -46,7 +46,7 @@
#include <signal.h>
#endif
#if (OS(LINUX) && !defined(__UCLIBC__))
#if (OS(LINUX) && !defined(__UCLIBC__) && !defined(FNL_MUSL))
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
......
......@@ -54,9 +54,9 @@ source_set("common") {
"//sky/services/pointer:interfaces",
"//sky/services/vsync:interfaces",
"//sky/shell/dart",
"//ui/gfx",
"//ui/gfx/geometry",
"//url",
"//ui/gl",
]
}
......@@ -70,6 +70,7 @@ source_set("gpu_direct") {
deps = [
":common",
"//ui/gl",
]
}
......@@ -255,7 +256,7 @@ if (is_android) {
sky_precompilation_sdk("shell") {
sdk_name = "SkySDK"
}
} else if (is_linux) {
} else if (is_linux && !is_fnl) {
executable("shell") {
output_name = "sky_shell"
......@@ -321,6 +322,8 @@ if (is_android) {
":sky_resources",
]
}
} else if (is_fnl) {
# Nothing fnl specific.
} else {
assert(false, "Unsupported platform")
}
......@@ -22,6 +22,7 @@
#include "mojo/edk/embedder/embedder.h"
#include "mojo/edk/embedder/simple_platform_support.h"
#include "sky/shell/shell.h"
#include "ui/gl/gl_surface.h"
using base::LazyInstance;
......@@ -77,6 +78,7 @@ static void Init(JNIEnv* env,
mojo::embedder::Init(std::unique_ptr<mojo::embedder::PlatformSupport>(
new mojo::embedder::SimplePlatformSupport()));
CHECK(gfx::GLSurface::InitializeOneOff());
Shell::InitStandalone();
InitializeTracing();
......
......@@ -64,6 +64,7 @@ int PlatformMacMain(int argc,
mojo::embedder::Init(std::unique_ptr<mojo::embedder::PlatformSupport>(
new mojo::embedder::SimplePlatformSupport()));
CHECK(gfx::GLSurface::InitializeOneOff());
sky::shell::Shell::InitStandalone();
result = callback();
......
......@@ -16,7 +16,6 @@
#include "mojo/message_pump/message_pump_mojo.h"
#include "sky/shell/ui/engine.h"
#include "sky/shell/switches.h"
#include "ui/gl/gl_surface.h"
namespace sky {
namespace shell {
......@@ -75,9 +74,6 @@ Shell::~Shell() {
void Shell::InitStandalone() {
CHECK(base::i18n::InitializeICU());
#if !defined(OS_LINUX)
CHECK(gfx::GLSurface::InitializeOneOff());
#endif
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess();
......
......@@ -16,6 +16,8 @@ def get_out_dir(args):
target_dir += 'android_'
elif args.target_os == 'ios':
target_dir += 'ios_'
elif args.target_os == 'fnl':
target_dir += 'fnl_'
if args.simulator:
target_dir += 'sim_'
......@@ -38,7 +40,7 @@ def to_gn_args(args):
gn_args = {}
gn_args['is_debug'] = args.debug
gn_args['is_clang'] = args.clang and args.target_os not in ['android']
gn_args['is_clang'] = args.clang and args.target_os not in ['android', 'fnl']
ios_target_cpu = 'arm64'
if args.ios_force_armv7:
......@@ -56,6 +58,10 @@ def to_gn_args(args):
else:
# The iOS simulator snapshot is host targetted
gn_args['dart_target_arch'] = ios_target_cpu
elif args.target_os == 'fnl':
gn_args['target_os'] = 'fnl'
gn_args['use_aura'] = False
gn_args['use_ozone'] = True
else:
gn_args['use_aura'] = False
gn_args['use_system_harfbuzz'] = False
......@@ -71,6 +77,12 @@ def to_gn_args(args):
else:
gn_args['target_cpu'] = 'x64'
if args.target_sysroot:
gn_args['target_sysroot'] = args.target_sysroot
if args.toolchain_prefix:
gn_args['toolchain_prefix'] = args.toolchain_prefix
goma_dir = os.environ.get('GOMA_DIR')
goma_home_dir = os.path.join(os.getenv('HOME', ''), 'goma')
if args.goma and goma_dir:
......@@ -94,6 +106,7 @@ def parse_args(args):
parser.add_argument('--target-os', type=str, choices=['android', 'ios'])
parser.add_argument('--android', dest='target_os', action='store_const', const='android')
parser.add_argument('--fnl', dest='target_os', action='store_const', const='fnl')
parser.add_argument('--ios', dest='target_os', action='store_const', const='ios')
parser.add_argument('--ios-force-armv7', dest='ios_force_armv7', action='store_true', default=False)
parser.add_argument('--simulator', action='store_true', default=False)
......@@ -104,6 +117,9 @@ def parse_args(args):
parser.add_argument('--clang', default=True, action='store_true')
parser.add_argument('--no-clang', dest='clang', action='store_false')
parser.add_argument('--target-sysroot', type=str)
parser.add_argument('--toolchain-prefix', type=str)
return parser.parse_args(args)
def main(argv):
......
......@@ -33,6 +33,10 @@ source_set("libevent") {
include_dirs = [ "android" ]
}
if (is_fnl) {
include_dirs += [ "compat" ]
}
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册