[build] Add support for building for Fuchsia from Mac.

TEST=./tools/build.py --os=fuchsia --mode=all runtime create_sdk
Change-Id: I6b15d1cc174b84d900d526730e5f58d64d2596cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216540
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
This commit is contained in:
Ryan Macnak
2021-10-13 21:14:56 +00:00
committed by commit-bot@chromium.org
parent 238a72a321
commit b4b7b8f116
6 changed files with 25 additions and 21 deletions
+2 -2
View File
@@ -124,8 +124,8 @@ group("compressed_observatory_archive") {
}
if (is_fuchsia) {
import("third_party/fuchsia/sdk/linux/build/component.gni")
import("third_party/fuchsia/sdk/linux/build/package.gni")
import("third_party/fuchsia/sdk/${host_os}/build/component.gni")
import("third_party/fuchsia/sdk/${host_os}/build/package.gni")
template("dart_fuchsia_test_package") {
fuchsia_package(target_name) {
+10
View File
@@ -604,6 +604,16 @@ deps = {
},
# Update from https://chrome-infra-packages.appspot.com/p/fuchsia/sdk/gn
Var("dart_root") + "/third_party/fuchsia/sdk/mac": {
"packages": [
{
"package": "fuchsia/sdk/gn/mac-amd64",
"version": "git_revision:190502a955c482431c2edd0525e128423728b662"
}
],
"condition": 'host_os == "mac" and host_cpu == "x64"',
"dep_type": "cipd",
},
Var("dart_root") + "/third_party/fuchsia/sdk/linux": {
"packages": [
{
+11 -5
View File
@@ -260,8 +260,8 @@ if (is_posix) {
}
if (is_fuchsia) {
_native_compiler_configs += [
"//third_party/fuchsia/sdk/linux/build/config:compiler",
"//third_party/fuchsia/sdk/linux/build/config:runtime_library",
"//third_party/fuchsia/sdk/${host_os}/build/config:compiler",
"//third_party/fuchsia/sdk/${host_os}/build/config:runtime_library",
]
}
@@ -405,10 +405,16 @@ if (is_win) {
host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
set_default_toolchain("//build/toolchain/mac:clang_$current_cpu")
} else if (is_fuchsia) {
assert(host_os == "linux")
assert(host_cpu == "x64")
host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
set_default_toolchain("//build/toolchain/fuchsia")
if (host_os == "linux") {
host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
set_default_toolchain("//build/toolchain/fuchsia")
} else if (host_os == "mac") {
host_toolchain = "//build/toolchain/mac:clang_$host_cpu"
set_default_toolchain("//build/toolchain/fuchsia")
} else {
assert(false, "Unknown host for fuchsia cross compile")
}
}
# ==============================================================================
+1 -1
View File
@@ -3,5 +3,5 @@
# found in the LICENSE file.
declare_args() {
clang_base_path = "//buildtools/linux-x64/clang"
clang_base_path = "//buildtools/${host_os}-x64/clang"
}
-12
View File
@@ -721,18 +721,6 @@ template("dart_executable") {
} else {
configs += [ "..:dart_maybe_product_config" ]
}
if (target_os != current_os && target_os == "fuchsia") {
# We already have these in the standalone build, but Fuchsia doesn't
# have them. They are needed for running Fuchsia binaries built for the
# host.
if (is_linux) {
# TODO(liama): Commenting this line out because it causes problems for
# --os=fuchsia. If no one complains, remove it.
# configs += [ "../../build/config/gcc:executable_ldconfig" ]
} else if (is_mac) {
configs += [ "../../build/config/mac:mac_dynamic_flags" ]
}
}
deps = [
":crashpad",
+1 -1
View File
@@ -375,7 +375,7 @@ def ProcessOptions(args):
% (os_name, arch))
return False
elif os_name == 'fuchsia':
if HOST_OS != 'linux':
if not HOST_OS in ['linux', 'macos']:
print(
"Cross-compilation to %s is not supported on host os %s." %
(os_name, HOST_OS))