summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/qt_configure.prf
diff options
context:
space:
mode:
Diffstat (limited to 'mkspecs/features/qt_configure.prf')
-rw-r--r--mkspecs/features/qt_configure.prf23
1 files changed, 14 insertions, 9 deletions
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 4372da6499..c4f24cddd8 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -360,12 +360,16 @@ defineTest(qtConfTest_getPkgConfigVariable) {
defineTest(qtConfTest_compile) {
test = $$eval($${1}.test)
+ host = $$eval($${1}.host)
+ isEmpty(host): host = false
# get package config information
qtConfTest_pkgConfig($${1})
test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test
test_out_dir = $$shadowed($$test_dir)
+ !isEmpty($${1}.pro): \
+ test_dir = $$test_dir/$$eval($${1}.pro)
test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&"
# Disable qmake features which are typically counterproductive for tests
@@ -383,13 +387,16 @@ defineTest(qtConfTest_compile) {
winrt: \
qmake_configs += " \"QMAKE_LFLAGS += /ENTRY:main\""
- # add compiler flags
- !isEmpty(EXTRA_DEFINES): \
- qmake_configs += "\"DEFINES += $$EXTRA_DEFINES\""
- !isEmpty(EXTRA_LIBS) \
- qmake_configs += "\"LIBS += $$EXTRA_LIBS\""
- !isEmpty(EXTRA_INCLUDEPATH): \
- qmake_configs += "\"INCLUDEPATH += $$EXTRA_INCLUDEPATH\""
+ !$$host {
+ # add compiler flags, these are set for the target and should not be applied to host tests
+ !isEmpty(EXTRA_DEFINES): \
+ qmake_configs += "\"DEFINES += $$EXTRA_DEFINES\""
+ !isEmpty(EXTRA_LIBS) \
+ qmake_configs += "\"LIBS += $$EXTRA_LIBS\""
+ !isEmpty(EXTRA_INCLUDEPATH): \
+ qmake_configs += "\"INCLUDEPATH += $$EXTRA_INCLUDEPATH\""
+ qmake_configs += $$EXTRA_QMAKE_ARGS
+ }
libs = $$eval($${1}.libs)
!isEmpty(libs): \
@@ -399,8 +406,6 @@ defineTest(qtConfTest_compile) {
!isEmpty(includedir): \
qmake_configs += "\"INCLUDEPATH *= $$includedir\""
- qmake_configs += $$EXTRA_QMAKE_ARGS
-
# Clean up after previous run
exists($$test_out_dir/Makefile): qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean")