diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2017-08-02 23:15:27 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2017-08-02 23:15:27 +0000 |
commit | 6c2bfbf88efa745882c636d9b91c4210b8fa5572 (patch) | |
tree | 54625073d07ee5830bdfba3853cf9d95ec211b7d /mkspecs | |
parent | 72cf2339edbb302b8b1dbe14c5475e8d2c3f62b1 (diff) | |
parent | ee07b912a1768ea0b103544f9eeac41f3cf50cf6 (diff) |
Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/common/android-base-tail.conf | 10 | ||||
-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 |
4 files changed, 74 insertions, 20 deletions
diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf index 2610918c4e..3f1b414d3f 100644 --- a/mkspecs/common/android-base-tail.conf +++ b/mkspecs/common/android-base-tail.conf @@ -15,8 +15,14 @@ QMAKE_CFLAGS += --sysroot=$$ANDROID_PLATFORM_ROOT_PATH QMAKE_CFLAGS_WARN_ON = -Wall -W QMAKE_CFLAGS_WARN_OFF = equals(ANDROID_TARGET_ARCH, armeabi-v7a) | equals(ANDROID_TARGET_ARCH, armeabi) { - QMAKE_CFLAGS_RELEASE = -Os - QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os + contains(QMAKE_COMPILER, clang) { + QMAKE_CFLAGS_RELEASE = -Oz + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Oz + } else { + QMAKE_CFLAGS_RELEASE = -Os + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Os + } + QMAKE_CFLAGS_DEBUG = -g -marm -O0 equals(ANDROID_TARGET_ARCH, armeabi):if(equals(NDK_TOOLCHAIN_VERSION, 4.8)|equals(NDK_TOOLCHAIN_VERSION, 4.9)) { DEFINES += QT_OS_ANDROID_GCC_48_WORKAROUND 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 |