diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-08-02 22:49:38 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-08-02 22:52:32 +0200 |
commit | ee07b912a1768ea0b103544f9eeac41f3cf50cf6 (patch) | |
tree | 15bfa7e4a9c098511c1fc89e2b2c240520b85e2d /mkspecs/features | |
parent | 4bfff6a98b59b32605d881a463ad3edc221a7dc8 (diff) | |
parent | a96656a8fb6a3c1fc7765659efff28f807fd0deb (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
src/plugins/platforms/xcb/qxcbconnection.h
src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
src/plugins/styles/mac/qmacstyle_mac.mm
src/widgets/widgets/qdockarealayout.cpp
src/widgets/widgets/qmainwindow.cpp
src/widgets/widgets/qmainwindowlayout.cpp
src/widgets/widgets/qmainwindowlayout_p.h
tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
tests/auto/other/macnativeevents/BLACKLIST
tests/auto/widgets/widgets/qmenu/BLACKLIST
Change-Id: Ic8e724b80a65e7b1af25511b0e674d209265e567
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/qt_app.prf | 4 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 77 | ||||
-rw-r--r-- | mkspecs/features/qt_tool.prf | 3 |
3 files changed, 66 insertions, 18 deletions
diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf index cb84ae0da8..883f8ca215 100644 --- a/mkspecs/features/qt_app.prf +++ b/mkspecs/features/qt_app.prf @@ -14,6 +14,10 @@ TEMPLATE = app load(qt_build_paths) DESTDIR = $$MODULE_BASE_OUTDIR/bin +isEmpty(VERSION): VERSION = $$MODULE_VERSION +isEmpty(QMAKE_TARGET_DESCRIPTION): \ + QMAKE_TARGET_DESCRIPTION = "Qt $$title($$TARGET)" + isEmpty(QMAKE_INFO_PLIST): CONFIG -= app_bundle # This decreases the binary size for tools if statically linked diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index f3db6b467d..c3ea334dd8 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -34,6 +34,18 @@ defineTest(qtConfFatalError) { error() } +# Return a string list for the specified JSON path, which may be either a +# single string or an array of strings. +# Note that this returns a variable name, so it can be directly iterated over. +defineReplace(qtConfScalarOrList) { + defined($$1, var): return($$1) + vals = $$list() + for (i, $${1}._KEYS_): \ + $$vals += $$eval($${1}.$$i) + export($$vals) + return($$vals) +} + defineTest(qtConfCommandlineSetInput) { arg = $${1} val = $${2} @@ -721,7 +733,7 @@ defineTest(qtConfHandleLibrary) { } # if the library defines a test, use it to verify the source. - !isEmpty($${lpfx}.test) { + !isEmpty($${lpfx}.test)|!isEmpty($${lpfx}.test._KEYS_) { $${lpfx}.literal_args = $$qtConfLibraryArgs($$spfx) $$use_args $${lpfx}.host = $$eval($${spfx}.host) !qtConfTest_compile($$lpfx) { @@ -843,16 +855,58 @@ defineTest(qtConfTestPrepare_compile) { return(true) } +defineTest(qtConfPrepareCompileTestSource) { + test_dir = $$2 + + # Create source code + contents = "/* Generated by configure */" + # Custom code before includes + for (ent, $$qtConfScalarOrList($${1}.head)): \ + contents += $$ent + # Includes + for (ent, $$qtConfScalarOrList($${1}.include)): \ + contents += "$${LITERAL_HASH}include <$$ent>" + # Custom code after includes + for (ent, $$qtConfScalarOrList($${1}.tail)): \ + contents += $$ent + # And finally the custom code inside main() + contents += \ + "int main(int argc, char **argv)" \ + "{" \ + " (void)argc; (void)argv;" \ + " /* BEGIN TEST: */" + for (ent, $$qtConfScalarOrList($${1}.main)): \ + contents += " $$ent" + contents += \ + " /* END TEST */" \ + " return 0;" \ + "}" + write_file($$test_dir/main.cpp, contents)|error() + + # Create stub .pro file + contents = "SOURCES = main.cpp" + # Custom project code + for (ent, $$qtConfScalarOrList($${1}.qmake)): \ + contents += $$ent + write_file($$test_dir/$$basename(test_dir).pro, contents)|error() +} + defineTest(qtConfTest_compile) { test = $$eval($${1}.test) host = $$eval($${1}.host) isEmpty(host): host = false - test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_base_out_dir = $$OUT_PWD/$$basename(QMAKE_CONFIG_TESTS_DIR) - test_out_dir = $$test_base_out_dir/$$test - !isEmpty($${1}.pro): \ - test_dir = $$test_dir/$$eval($${1}.pro) + isEmpty(test) { + test_dir = $$test_base_out_dir/$$section(1, ".", -1) + test_out_dir = $$test_dir + qtConfPrepareCompileTestSource($${1}.test, $$test_dir) + } else { + test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test + test_out_dir = $$test_base_out_dir/$$test + !isEmpty($${1}.pro): \ + test_dir = $$test_dir/$$eval($${1}.pro) + } test_cmd_base = "$$QMAKE_CD $$system_quote($$system_path($$test_out_dir)) &&" qmake_args = $$qtConfPkgConfigEnv()$$system_quote($$system_path($$QMAKE_QMAKE)) @@ -1340,17 +1394,10 @@ defineTest(qtConfCheckFeature) { # feature not auto-detected and not explicitly enabled result = false } else { - condition = $$eval($${fpfx}.condition) - !isEmpty(condition) { + result = true + for (condition, $$qtConfScalarOrList($${fpfx}.condition)) { result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled) - } else { - result = true - # check whether we have an array of conditions - for (i, $${fpfx}.condition._KEYS_) { - condition = $$eval($${fpfx}.condition.$$i) - result = $$qtConfCheckSingleCondition($$1, $$condition, $$enabled) - !$$result: break() - } + !$$result: break() } } $${fpfx}.available = $$result diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index a516e5ba4b..a8d589f0fa 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -10,9 +10,6 @@ # CONFIG += no_launch_target -isEmpty(VERSION): VERSION = $$MODULE_VERSION -isEmpty(QMAKE_TARGET_DESCRIPTION): QMAKE_TARGET_DESCRIPTION = \ - "Tool for the Qt Application Development Framework" load(qt_app) CONFIG += console |