Add fnl build configuration

This commit is contained in:
George Kulakowski
2015-11-16 13:27:56 -08:00
parent aea152d8cc
commit 313adcf23d
7 changed files with 128 additions and 3 deletions

View File

@@ -272,6 +272,9 @@ config("feature_flags") {
if (enable_webvr) {
defines += [ "ENABLE_WEBVR" ]
}
if (is_fnl) {
defines += [ "HAVE_SYS_QUEUE_H_=0" ]
}
}
# Debug/release ----------------------------------------------------------------

View File

@@ -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)

View File

@@ -0,0 +1,48 @@
# 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" ]
}
}

View File

@@ -0,0 +1,24 @@
# 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
}

View File

@@ -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" ]
}

View File

@@ -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",

View File

@@ -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):