Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/config/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import("//build/config/sysroot.gni")
config("sdk") {
if (sysroot != "") {
cflags = [ "--sysroot=" + sysroot ]
ldflags = [ "-L" + rebase_path("$android_lib") ]
ldflags = [ "-L" + rebase_path("$android_lib", root_build_dir) ]

# Need to get some linker flags out of the sysroot.
sysroot_ld_path = rebase_path("//build/config/linux/sysroot_ld_path.py")
Expand Down
21 changes: 16 additions & 5 deletions build/config/compiler/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,28 @@ config("compiler") {
# These flags are shared between the C compiler and linker.
common_mac_flags = []

if (is_mac) {
if (current_cpu == "arm64") {
common_mac_flags += [ "--target=arm64-apple-macos" ]
} else if (current_cpu == "x64") {
common_mac_flags += [ "--target=x86_64-apple-macos" ]
}
}

if (is_ios) {
if (current_cpu == "arm64") {
common_mac_flags += [ "--target=arm64-apple-darwin" ]
} else if (current_cpu == "x64") {
common_mac_flags += [ "--target=x86_64-apple-darwin" ]
}
}

# CPU architecture.
if (current_cpu == "x64") {
common_mac_flags += [
"-arch",
"x86_64",
]
} else if (current_cpu == "x86") {
common_mac_flags += [
"-arch",
"i386",
]
} else if (current_cpu == "arm64") {
common_mac_flags += [
"-arch",
Expand Down
5 changes: 3 additions & 2 deletions build/config/ios/ios_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# found in the LICENSE file.

import("//build/toolchain/goma.gni")
import("//build/toolchain/rbe.gni")

declare_args() {
# SDK path to use. When empty this will use the default SDK based on the
Expand Down Expand Up @@ -30,10 +31,10 @@ declare_args() {

if (ios_sdk_path == "") {
ios_sdk_args = []
if (use_goma && create_xcode_symlinks) {
if ((use_goma || use_rbe) && create_xcode_symlinks) {
ios_sdk_args += [
"--symlink",
rebase_path(root_gen_dir),
rebase_path("//flutter/prebuilts"),
]
}
if (!use_ios_simulator && ios_device_sdk_path == "") {
Expand Down
5 changes: 3 additions & 2 deletions build/config/mac/mac_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# found in the LICENSE file.

import("//build/toolchain/goma.gni")
import("//build/toolchain/rbe.gni")

declare_args() {
# Minimum supported version of the Mac SDK.
Expand All @@ -20,11 +21,11 @@ declare_args() {

if (mac_sdk_path == "") {
find_sdk_args = []
if (use_goma && create_xcode_symlinks) {
if ((use_goma || use_rbe) && create_xcode_symlinks) {
# RBE has a restriction that paths cannot come from outside the build root.
find_sdk_args += [
"--symlink",
rebase_path(root_gen_dir),
rebase_path("//flutter/prebuilts"),
]
}
find_sdk_args += [
Expand Down
9 changes: 0 additions & 9 deletions build/rbe.cfg

This file was deleted.

14 changes: 3 additions & 11 deletions build/toolchain/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,14 @@ template("android_gcc_toolchain") {
tool_prefix = rebase_path(invoker.tool_prefix, root_build_dir)

if (use_goma) {
assert(!use_rbe, "Goma and RBE can't be used together.")
assert(!use_ccache, "Goma and ccache can't be used together.")
compiler_prefix = "$goma_dir/gomacc "
link_prefix = "$goma_dir/gomacc "
} else if (use_rbe) {
assert(!use_goma)
rewrapper_args = [
"$rbe_dir/rewrapper",
"--server_address=$rbe_server_address",
"--exec_strategy=$rbe_exec_strategy",
"--dial_timeout=$rbe_dial_timeout",
"--exec_root=$rbe_exec_root",
"--platform=$rbe_platform",
]
compiler_args =
rewrapper_args + [ "--labels=type=compile,compiler=clang,lang=cpp " ]
link_args = rewrapper_args + [ "--labels=type=link,tool=clang " ]
rewrapper_command + [ "--labels=type=compile,compiler=clang,lang=cpp " ]
link_args = rewrapper_command + [ "--labels=type=link,tool=clang " ]
compiler_prefix = string_join(" ", compiler_args)
link_prefix = string_join(" ", link_args)
} else if (use_ccache) {
Expand Down
14 changes: 3 additions & 11 deletions build/toolchain/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,14 @@ declare_args() {
}

if (use_goma) {
assert(!use_rbe, "Goma and RBE can't be used together.")
assert(!use_ccache, "Goma and ccache can't be used together.")
compiler_prefix = "$goma_dir/gomacc "
link_prefix = "$goma_dir/gomacc "
} else if (use_rbe) {
assert(!use_goma)
rewrapper_args = [
"$rbe_dir/rewrapper",
"--server_address=$rbe_server_address",
"--exec_strategy=$rbe_exec_strategy",
"--dial_timeout=$rbe_dial_timeout",
"--exec_root=$rbe_exec_root",
"--platform=$rbe_platform",
]
compiler_args =
rewrapper_args + [ "--labels=type=compile,compiler=clang,lang=cpp " ]
link_args = rewrapper_args + [ "--labels=type=link,tool=clang " ]
rewrapper_command + [ "--labels=type=compile,compiler=clang,lang=cpp " ]
link_args = rewrapper_command + [ "--labels=type=link,tool=clang " ]
compiler_prefix = string_join(" ", compiler_args)
link_prefix = string_join(" ", link_args)
} else if (use_ccache) {
Expand Down
Loading