summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael BrĂ¼ning <michael.bruning@qt.io>2019-03-01 10:41:34 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-04 10:20:54 +0200
commit213869f39631b49da9755996389bd86743b41971 (patch)
tree4fe532f33be6764762ae8d762d3f0af752f1e2f7
parent238e81ff331c53c49eecb4cf95e65e4a3aceb31d (diff)
downloadqtwebengine-chromium-213869f39631b49da9755996389bd86743b41971.tar.gz
Add isysroot parameter for macOS to build gn with the right toolchain
Uses the isysroot passed in, which will be set to $$QMAKE_MAC_SDK_PATH by the WebEngine build scripts. Leaving this out when specifying a tool chain leads to problems on macOS 10.14 when the command line tools are also installed, as some symlinks point to the wrong clang executable. We also add the isysroot for the rest of Qt and Chromium detects it as well, so this adds to consistency as well. Cherry-pick from 71-based. Change-Id: I267c0428f0a472a026451aefaf558e5d6c129303 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rwxr-xr-xgn/build/gen.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gn/build/gen.py b/gn/build/gen.py
index 767a444ec8d..d454d3eab53 100755
--- a/gn/build/gen.py
+++ b/gn/build/gen.py
@@ -137,7 +137,8 @@ def main(argv):
help='The path to ld.')
parser.add_option('--ar',
help='The path to ar.')
-
+ parser.add_option('--isysroot',
+ help='The path to the macOS SDK sysroot to be used.')
options, args = parser.parse_args(argv)
if args:
@@ -357,6 +358,8 @@ def WriteGNNinja(path, platform, host, options):
if options.no_strip:
cflags.append('-g')
ldflags.append('-O3')
+ if platform.is_darwin() and options.isysroot:
+ cflags.append('-isysroot ' + options.isysroot)
# Use -fdata-sections and -ffunction-sections to place each function
# or data item into its own section so --gc-sections can eliminate any
# unused functions and data items.