From 2982d327f7c51f448e91e12da29179d980027931 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 3 Feb 2017 18:23:04 +0100 Subject: 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 --- configure.json | 2 +- configure.pri | 11 +++++++++++ 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" -- cgit v1.2.3