summaryrefslogtreecommitdiffstats
path: root/mkspecs/features
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-01-12 20:52:51 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2017-01-20 09:29:52 +0000
commitf67afee9e932dd220474227882a745233455d729 (patch)
treeebc09961458cf2dc53d41a254eee9147434dbbc8 /mkspecs/features
parent6834d0eeccc7333ab9d53251b3bd4a24058843da (diff)
determine QMAKE_DEFAULT_{INC,LIB}DIRS separately for host and target
note that in principle this leaves room for a race condition, as the first project to determine the host config is not going to be the top-level one. in qtbase and qtdeclarative, this is naturally serialized via the common bootstrapped libraries (bootstrap resp. qmldevtools). activeqt, qt3d, qtscxml, and qtwayland all build only one bootstrapped tool each. qtwebengine makes a fake host build to create files for gyp/gn; the convert_dict tool is declared a host tool, but isn't actually built when x-building anyway, and even if, it's serialized on the former. qttools needs explicit serialization, though. no other host builds exist within qt as of now. Task-number: QTBUG-58126 Change-Id: I81a02a2d98f2bfe5d6aaa51119d5e7919549f119 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'mkspecs/features')
-rw-r--r--mkspecs/features/toolchain.prf21
1 files changed, 13 insertions, 8 deletions
diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf
index fdefd513e3..9e11ab9958 100644
--- a/mkspecs/features/toolchain.prf
+++ b/mkspecs/features/toolchain.prf
@@ -12,7 +12,12 @@ defineReplace(qtMakeExpand) {
}
}
-isEmpty(QMAKE_DEFAULT_INCDIRS):!host_build {
+host_build: \
+ target_prefix = QMAKE_HOST_CXX
+else: \
+ target_prefix = QMAKE_CXX
+
+isEmpty($${target_prefix}.INCDIRS) {
#
# Get default include and library paths from compiler
#
@@ -44,6 +49,8 @@ isEmpty(QMAKE_DEFAULT_INCDIRS):!host_build {
}
QMAKE_DEFAULT_LIBDIRS = $$unique(QMAKE_DEFAULT_LIBDIRS)
} else: msvc {
+ # This doesn't differentiate between host and target,
+ # but neither do the compilers.
LIB = $$getenv("LIB")
QMAKE_DEFAULT_LIBDIRS = $$split(LIB, $$QMAKE_DIRLIST_SEP)
INCLUDE = $$getenv("INCLUDE")
@@ -55,8 +62,11 @@ isEmpty(QMAKE_DEFAULT_INCDIRS):!host_build {
isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib
}
- !isEmpty(QMAKE_DEFAULT_INCDIRS): cache(QMAKE_DEFAULT_INCDIRS, set stash)
- !isEmpty(QMAKE_DEFAULT_LIBDIRS): cache(QMAKE_DEFAULT_LIBDIRS, set stash)
+ cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS)
+ cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS)
+} else {
+ QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS)
+ QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS)
}
#
@@ -73,11 +83,6 @@ defineReplace(qtVariablesFromGCC) {
return($$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines))
}
-host_build: \
- target_prefix = QMAKE_HOST_CXX
-else: \
- target_prefix = QMAKE_CXX
-
isEmpty($${target_prefix}.COMPILER_MACROS) {
msvc {
clang_cl {