diff options
author | Lars Knoll <lars.knoll@qt.io> | 2016-06-27 10:56:50 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2016-07-05 15:48:53 +0000 |
commit | 27be7c764e22e5e3b03c73db26150f2740095c04 (patch) | |
tree | fd0cc27efd823a01caf03ca972351a25ff72738f /mkspecs | |
parent | 7331d22c6f55b6cd76bcf05bc70ebac69cf51eb9 (diff) |
Make more configure tests work on Windows
Change-Id: I87d775de7b6d790a44bbc3c9598d617ad57d9d4c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/qt_configure.prf | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 6f4b608f82..f9c00da330 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -380,38 +380,44 @@ defineTest(qtConfTest_compile) { test_cmd_base = "cd $$system_quote($$system_path($$test_out_dir)) &&" # Disable qmake features which are typically counterproductive for tests - qmake_configs = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\"" + qmake_args = "\"CONFIG -= qt debug_and_release app_bundle lib_bundle\"" # allow tests to behave differently depending on the type of library # being built (shared/static). e.g. see config.tests/unix/icu shared: \ - qmake_configs += "\"CONFIG += shared\"" + qmake_configs = "shared" else: \ - qmake_configs += "\"CONFIG += static\"" + qmake_configs = "static" + + # add console to the CONFIG variable when running the tests, so that they + # can work with a regular main() entry point on Windows. + qmake_configs += "console" + + qmake_args += "\"CONFIG += $$qmake_configs\"" # On WinRT we need to change the entry point as we cannot create windows # applications winrt: \ - qmake_configs += " \"QMAKE_LFLAGS += /ENTRY:main\"" + qmake_args += " \"QMAKE_LFLAGS += /ENTRY:main\"" !$$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\"" + qmake_args += "\"DEFINES += $$EXTRA_DEFINES\"" !isEmpty(EXTRA_LIBS) \ - qmake_configs += "\"LIBS += $$EXTRA_LIBS\"" + qmake_args += "\"LIBS += $$EXTRA_LIBS\"" !isEmpty(EXTRA_INCLUDEPATH): \ - qmake_configs += "\"INCLUDEPATH += $$EXTRA_INCLUDEPATH\"" - qmake_configs += $$EXTRA_QMAKE_ARGS + qmake_args += "\"INCLUDEPATH += $$EXTRA_INCLUDEPATH\"" + qmake_args += $$EXTRA_QMAKE_ARGS } libs = $$eval($${1}.libs) !isEmpty(libs): \ - qmake_configs += "\"LIBS += $$libs\"" + qmake_args += "\"LIBS += $$libs\"" includedir = $$eval($${1}.includedir) !isEmpty(includedir): \ - qmake_configs += "\"INCLUDEPATH *= $$includedir\"" + qmake_args += "\"INCLUDEPATH *= $$includedir\"" # Clean up after previous run exists($$test_out_dir/Makefile): qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE distclean") @@ -421,9 +427,9 @@ defineTest(qtConfTest_compile) { !isEmpty(QMAKE_QTCONF): qtconfarg = -qtconf $$QMAKE_QTCONF # add possible command line args - qmake_configs += $$qtConfPrepareArgs($$eval($${1}.args)) + qmake_args += $$qtConfPrepareArgs($$eval($${1}.args)) - qtRunLoggedCommand("$$test_cmd_base $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) $$qtconfarg $$qmake_configs $$shell_quote($$test_dir)") { + qtRunLoggedCommand("$$test_cmd_base $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) $$qtconfarg $$qmake_args $$shell_quote($$test_dir)") { qtRunLoggedCommand("$$test_cmd_base $$QMAKE_MAKE"): \ return(true) } |