diff options
author | Jake Petroules <jake.petroules@qt.io> | 2017-01-25 18:52:22 -0800 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-01-26 20:10:27 +0000 |
commit | 6d5489f5df1220ac82d76bbee1f3caa93b34100d (patch) | |
tree | 5b4386b642b5ad71443eb6a5b198370c1993a05e /mkspecs | |
parent | 0feeb6f6d2cfaa964763ca1fcab65672812b4eef (diff) |
Apple: fix QMAKE_DEFAULT_INCDIRS so compiler invocations use the sysroot
The compiler command line used to populate QMAKE_DEFAULT_INCDIRS must
include the sysroot in order to generate the correct paths list.
This fixes a regression introduced in afd8263 which in turn attempted to
fix an earlier regression making it impossible to override the
deployment target in user project files.
Task-number: QTBUG-58325
Change-Id: I93e6b7ef90b2744dd2f03c77da31c692cb194976
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/toolchain.prf | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 15b0829235..6d96eaf689 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -29,7 +29,18 @@ isEmpty($${target_prefix}.INCDIRS) { cmd_prefix = "set LC_ALL=C&" cmd_suffix = "<NUL >NUL" } - output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$QMAKE_CXXFLAGS) -xc++ -E -v - 2>&1 $$cmd_suffix", lines) + + cxx_flags = $$QMAKE_CXXFLAGS + + # Manually inject the sysroot for Apple Platforms because its resolution + # normally does not happen until default_post.prf. This is especially + # important for moc to gain the correct default include directory list. + # While technically incorrect but without any likely practical effect, + # UIKit simulator platforms will see the device SDK's sysroot in + # QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass. + darwin: cxx_flags += -isysroot $$QMAKE_MAC_SDK_PATH + + output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ -E -v - 2>&1 $$cmd_suffix", lines) add_includes = false for (line, output) { line ~= s/^ *// # remove leading spaces |