[build] Dynamically decide if to use system xcode

This enables the recipe to set FORCE_MAC_TOOLCHAIN and decide if hermetic
or system xcode is used.

TBR=tmrts@chromium.org

Bug: chromium:986701
Change-Id: I2c1ba75d5d62e493bd9dc7a5ec5f7e40465d8f98
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1722557
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62947}
This commit is contained in:
Michael Achenbach 2019-07-29 09:55:29 +02:00 committed by Commit Bot
parent 6cb6f8ee04
commit 561e517528
2 changed files with 15 additions and 3 deletions

3
.gn
View File

@ -16,4 +16,5 @@ check_targets = []
# These are the list of GN files that run exec_script. This whitelist exists
# to force additional review for new uses of exec_script, which is strongly
# discouraged except for gypi_to_gn calls.
exec_script_whitelist = build_dotfile_settings.exec_script_whitelist + []
exec_script_whitelist = build_dotfile_settings.exec_script_whitelist +
[ "//build_overrides/build.gni" ]

View File

@ -35,5 +35,16 @@ tsan_suppressions_file = "//build/sanitizers/tsan_suppressions.cc"
# Skip assertions about 4GiB file size limit.
ignore_elf32_limitations = true
# Use the system install of Xcode for tools like ibtool, libtool, etc.
use_system_xcode = true
if (host_os == "mac") {
_result = exec_script("//build/mac/should_use_hermetic_xcode.py",
[ target_os ],
"value")
assert(_result != 2,
"Do not allow building targets with the default" +
"hermetic toolchain if the minimum OS version is not met.")
assert(_result != 3,
"iOS does not support building with a hermetic toolchain. " +
"Please install Xcode.")
use_system_xcode = _result == 0
}