diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2019-06-05 12:42:14 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2019-06-05 13:02:22 +0200 |
commit | 99636127d10f96d8313bc26030cabf9841381914 (patch) | |
tree | 80299bf3749450f493cc4e7952bfd73b6e280e51 /mkspecs | |
parent | d212c179db318a20d74592b02dd57b9bb1b668ce (diff) |
Fix prefix_build check for top-level builds
The checks whether we have a Qt prefix build were broken for
top-level builds. Non-prefix top-level builds were incorrectly
detected as prefix builds.
For top-level non-prefix builds QT_HOST_DATA/QT_INSTALL_PREFIX becomes
something like "~/my/build/dir/qtbase" but .qmake.cache (and
.qmake.super) is/are created in "~/my/build/dir".
This patch extends the prefix_build check by probing for the existence
of .qmake.super, which only exists for top-level builds. Also, we add
qt_prefix_build_check.prf as central place for determining whether we
have a prefix build to make sure that qt_configure.prf and
qt_build_config.prf use the same logic.
Fixes: QTBUG-76185
Change-Id: I2b76fe26013496aaf2dac96ea711b06a69550a29
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/qt_build_config.prf | 4 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 10 | ||||
-rw-r--r-- | mkspecs/features/qt_prefix_build_check.prf | 21 |
3 files changed, 30 insertions, 5 deletions
diff --git a/mkspecs/features/qt_build_config.prf b/mkspecs/features/qt_build_config.prf index 0c6c10dded..8a7c9c28d3 100644 --- a/mkspecs/features/qt_build_config.prf +++ b/mkspecs/features/qt_build_config.prf @@ -37,8 +37,10 @@ intel_icl { QMAKE_DIR_REPLACE_SANE = PRECOMPILED_DIR OBJECTS_DIR MOC_DIR RCC_DIR UI_DIR +load(qt_prefix_build_check) + # force_independent can be set externally. prefix_build not. -!exists($$[QT_HOST_DATA]/.qmake.cache): \ +qtIsPrefixBuild($$[QT_HOST_DATA]): \ CONFIG += prefix_build force_independent !build_pass:!isEmpty(_QMAKE_SUPER_CACHE_):force_independent { diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 95e54d72c9..242544d41b 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -2502,17 +2502,19 @@ logn("Configure summary:") logn() qtConfPrintReport() +load(qt_prefix_build_check) + # final notes for the user logn() logn("Qt is now configured for building. Just run '$$QMAKE_MAKE_NAME'.") pfx = $$[QT_INSTALL_PREFIX] -exists($$pfx/.qmake.cache) { +qtIsPrefixBuild($$pfx) { + logn("Once everything is built, you must run '$$QMAKE_MAKE_NAME install'.") + logn("Qt will be installed into '$$system_path($$pfx)'.") +} else { logn("Once everything is built, Qt is installed.") logn("You should NOT run '$$QMAKE_MAKE_NAME install'.") logn("Note that this build cannot be deployed to other machines or devices.") -} else { - logn("Once everything is built, you must run '$$QMAKE_MAKE_NAME install'.") - logn("Qt will be installed into '$$system_path($$pfx)'.") } logn() logn("Prior to reconfiguration, make sure you remove any leftovers from") diff --git a/mkspecs/features/qt_prefix_build_check.prf b/mkspecs/features/qt_prefix_build_check.prf new file mode 100644 index 0000000000..3f98847de9 --- /dev/null +++ b/mkspecs/features/qt_prefix_build_check.prf @@ -0,0 +1,21 @@ +# +# W A R N I N G +# ------------- +# +# This file is not part of the Qt API. It exists purely as an +# implementation detail. It may change from version to version +# without notice, or even be removed. +# +# We mean it. +# + +defineTest(qtIsPrefixBuild) { + prefixdir = $$1 + # qtbase non-prefix build? + exists($$prefixdir/.qmake.cache): \ + return(false) + # top-level non-prefix build? + contains(prefixdir, .*/qtbase):exists($$dirname(prefixdir)/.qmake.super): \ + return(false) + return(true) +} |