From 6ecd76ae8da49b22ca380c7bb9fe9256730f031e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20H=C3=B6glund?= Date: Tue, 20 Mar 2018 09:02:05 +0100 Subject: [PATCH] Make libyuv use the hermetic xcode toolchain. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is what Chromium is moving to, and what WebRTC is using. Next step: pull xcode via CIPD. Bug:chromium:633032 Change-Id: I6a21aa0e5b212a3a9cb4e7cc79ebb614a89f73ed Reviewed-on: https://chromium-review.googlesource.com/915921 Commit-Queue: Patrik Höglund Reviewed-by: Frank Barchard --- .gn | 2 +- DEPS | 6 ++++++ build_overrides/build.gni | 14 +++++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.gn b/.gn index 26a4a62d1..fc66637f3 100644 --- a/.gn +++ b/.gn @@ -29,7 +29,7 @@ exec_script_whitelist = build_dotfile_settings.exec_script_whitelist + [ "//build_overrides/build.gni" ] default_args = { - mac_sdk_min = "10.11" + mac_sdk_min = "10.12" # LibYUV does not want to switch to C++14 yet. use_cxx11 = true diff --git a/DEPS b/DEPS index 266327470..710a8a2b7 100644 --- a/DEPS +++ b/DEPS @@ -197,6 +197,12 @@ hooks = [ 'pattern': '.', 'action': ['python', 'src/build/vs_toolchain.py', 'update'], }, + { + # Update the Mac toolchain if necessary. + 'name': 'mac_toolchain', + 'pattern': '.', + 'action': ['python', 'src/build/mac_toolchain.py'], + }, # Pull binutils for linux, enabled debug fission for faster linking / # debugging when used with clang on Ubuntu Precise. # https://code.google.com/p/chromium/issues/detail?id=352046 diff --git a/build_overrides/build.gni b/build_overrides/build.gni index 9bb73ab02..6d8319b96 100644 --- a/build_overrides/build.gni +++ b/build_overrides/build.gni @@ -33,6 +33,14 @@ ubsan_vptr_blacklist_path = # so we just ignore that assert. See https://crbug.com/648948 for more info. ignore_elf32_limitations = true -# Use system Xcode installation instead of the Chromium bundled Mac toolchain, -# since it contains only SDK 10.11, not 10.12 which WebRTC needs. -use_system_xcode = true +# Use bundled hermetic Xcode installation maintained by Chromium, +# except for local iOS builds where it is unsupported. +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.") + use_system_xcode = _result == 0 +}