Skip to content

Commit

Permalink
Allow specifying custom toolchains and sysroots for host builds. (flu…
Browse files Browse the repository at this point in the history
…tter#6548)

Updates buildroot to flutter/buildroot#180.
  • Loading branch information
chinmaygarde authored Oct 15, 2018
1 parent c645657 commit 08272ee
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ allowed_hosts = [
]

deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '2f0e56e63f92f1a8b80603e4b1c671fcf7b04feb',
'src': 'https://github.com/flutter/buildroot.git' + '@' + '378efdc3507cef3204a164132cdeab04ea8e907e',

# Fuchsia compatibility
#
Expand Down
10 changes: 5 additions & 5 deletions shell/platform/embedder/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ source_set("embedder") {
sources = [
"embedder.cc",
"embedder.h",
"embedder_engine.cc",
"embedder_engine.h",
"embedder_include.c",
"embedder_surface.cc",
"embedder_surface.h",
"embedder_surface_gl.cc",
"embedder_surface_gl.h",
"embedder_surface_software.cc",
"embedder_surface_software.h",
"embedder_engine.cc",
"embedder_engine.h",
"embedder_include.c",
"platform_view_embedder.cc",
"platform_view_embedder.h",
]
Expand Down Expand Up @@ -92,7 +92,7 @@ copy("copy_headers") {
]
}

if (is_mac) {
if (is_mac && !embedder_for_target) {
_flutter_embedder_framework_dir = "$root_out_dir/FlutterEmbedder.framework"

copy("copy_dylib") {
Expand Down Expand Up @@ -225,7 +225,7 @@ group("flutter_engine") {
]

# For the Mac, the dylib is packaged in a framework with the appropriate headers.
if (is_mac) {
if (is_mac && !embedder_for_target) {
deps += [ ":flutter_embedder_framework" ]
}
}
Expand Down
17 changes: 16 additions & 1 deletion tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def to_gn_args(args):
gn_args['use_ios_simulator'] = args.simulator
if not args.simulator:
aot = True
elif args.target_os is not None:
gn_args['target_os'] = args.target_os
else:
aot = False

Expand Down Expand Up @@ -179,6 +181,13 @@ def to_gn_args(args):

if args.target_sysroot:
gn_args['target_sysroot'] = args.target_sysroot
gn_args['custom_sysroot'] = args.target_sysroot

if args.target_toolchain:
gn_args['custom_toolchain'] = args.target_toolchain

if args.target_triple:
gn_args['custom_target_triple'] = args.target_triple

if args.toolchain_prefix:
gn_args['toolchain_prefix'] = args.toolchain_prefix
Expand Down Expand Up @@ -206,6 +215,9 @@ def to_gn_args(args):
# even with -fPIC everywhere.
# gn_args['enable_profiling'] = args.runtime_mode != 'release' and args.android_cpu != 'x86'

if args.arm_float_abi:
gn_args['arm_float_abi'] = args.arm_float_abi

return gn_args

def parse_args(args):
Expand All @@ -225,7 +237,8 @@ def parse_args(args):
parser.add_argument('--ios', dest='target_os', action='store_const', const='ios')
parser.add_argument('--ios-cpu', type=str, choices=['arm', 'arm64'], default='arm64')
parser.add_argument('--simulator', action='store_true', default=False)
parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64'])
parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64', 'arm'])
parser.add_argument('--arm-float-abi', type=str, choices=['hard', 'soft', 'softfp'])

parser.add_argument('--goma', default=True, action='store_true')
parser.add_argument('--no-goma', dest='goma', action='store_false')
Expand All @@ -237,6 +250,8 @@ def parse_args(args):
parser.add_argument('--no-clang', dest='clang', action='store_false')

parser.add_argument('--target-sysroot', type=str)
parser.add_argument('--target-toolchain', type=str)
parser.add_argument('--target-triple', type=str)
parser.add_argument('--toolchain-prefix', type=str)

parser.add_argument('--enable-vulkan', action='store_true', default=False)
Expand Down

0 comments on commit 08272ee

Please sign in to comment.