From 27be7c764e22e5e3b03c73db26150f2740095c04 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 27 Jun 2016 10:56:50 +0200 Subject: Make more configure tests work on Windows Change-Id: I87d775de7b6d790a44bbc3c9598d617ad57d9d4c Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 30 ++++++++++++++++++------------ 1 file 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) } -- cgit v1.2.3