diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-02-03 18:23:04 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2017-02-06 16:34:22 +0000 |
commit | 2982d327f7c51f448e91e12da29179d980027931 (patch) | |
tree | a553cf9a1026deebca31fbeb16f9486b67f644c7 | |
parent | 4adc1012e19f5e12ab2fb96effc9ea88d2a05eda (diff) |
adjust configure to native build optimizations
don't fail to set up cross_compile early enough. otherwise, we'd
populate the cache for target builds with data for the host.
amends 6b8666c7 and 5060740f.
conversely, pass on extra flags to configure tests when not cross
building.
amends d8be8110 (and 2c5eb3e6).
Task-number: QTBUG-58556
Change-Id: I531d71e06204a0b17ae6dabf017a52e0f2efd9a7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | configure.json | 2 | ||||
-rw-r--r-- | configure.pri | 11 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 8 |
3 files changed, 19 insertions, 2 deletions
diff --git a/configure.json b/configure.json index e9ffc972ab..9a9645a23a 100644 --- a/configure.json +++ b/configure.json @@ -454,7 +454,7 @@ "cross_compile": { "label": "Cross compiling", "condition": "call.crossCompile", - "output": [ "publicConfig", "privateConfig" ] + "output": [ "publicConfig", "privateConfig", "crossCompile" ] }, "cxx11default": { "label": "Compiler defaults to C++11 or higher", diff --git a/configure.pri b/configure.pri index d49f5f8db2..74eef36667 100644 --- a/configure.pri +++ b/configure.pri @@ -830,6 +830,9 @@ defineTest(qtConfOutput_reloadSpec) { !isEmpty(config.input.sysroot): \ reloadSpec() + # toolchain.prf uses this. + dummy = $$qtConfEvaluate("features.cross_compile") + bypassNesting() { QMAKE_INTERNAL_INCLUDED_FEATURES -= \ $$[QT_HOST_DATA/src]/mkspecs/features/mac/toolchain.prf \ @@ -913,6 +916,14 @@ defineTest(qtConfOutput_pkgConfig) { } } +defineTest(qtConfOutput_crossCompile) { + !$${2}: return() + + # We need to preempt the output here, as subsequent tests rely on it + CONFIG += cross_compile + export(CONFIG) +} + defineTest(qtConfOutput_useGoldLinker) { !$${2}: return() diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 1f7fb1b292..81c63205a7 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -746,7 +746,7 @@ defineTest(qtConfTest_compile) { qmake_args += "\"CONFIG += $$qmake_configs\"" - !$$host { + !$$host|!cross_compile { # On WinRT we need to change the entry point as we cannot create windows # applications winrt: \ @@ -764,6 +764,12 @@ defineTest(qtConfTest_compile) { qmake_args += $$EXTRA_QMAKE_ARGS } + # make sure to make this the last override (because of -early) + cross_compile { + # must be done before loading default_pre.prf. + qmake_args += -early "\"CONFIG += cross_compile\"" + } + # Clean up after previous run exists($$test_out_dir/Makefile): \ QMAKE_MAKE = "$$QMAKE_MAKE clean && $$QMAKE_MAKE" |