From 07d3cbbe8450f870446f4bd2af2ec47baff23dc3 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Mon, 20 Jun 2016 00:11:34 +0200 Subject: Add warning when using pkg-config with a Qt build with it disabled This patch adds a warning that will be shown when link_pkgconfig is used in a project but Qt's configuration has it disabled. This can happen when Qt is built before pkg-config has been installed or if it's not detected. This will avoid user losing time trying to make pkg-config work while Qt just ignores it. Change-Id: Ieeff8dd6784b9430cfebef355855ec1be91bc96e Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_functions.prf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mkspecs/features') diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 86396958f1..4a1d265a8b 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -250,7 +250,10 @@ defineReplace(pkgConfigExecutable) { } defineTest(packagesExist) { - contains(QT_CONFIG, no-pkg-config):return(false) + contains(QT_CONFIG, no-pkg-config) { + warning("pkg-config disabled, can't check package existence") + return(false) + } # this can't be done in global scope here because qt_functions is loaded # before the .pro is parsed, so if the .pro set PKG_CONFIG, we wouldn't know it -- cgit v1.2.3 From fc57a6587b75a56b5f2f041c94a7ae656eba54b9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 8 Jul 2016 19:02:59 +0200 Subject: remove redundant condition from private module use warning the whole point of the check is ensuring that the message is printed only once for each sub-project, so !build_pass alone is fully adequate. Change-Id: Ib8f821ead6709efc9bfa935e1d05f8caba02a814 Reviewed-by: Jake Petroules --- mkspecs/features/qt.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mkspecs/features') diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 75b84ff6aa..be08a2a051 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -156,7 +156,7 @@ for(ever) { !isEmpty(var_sfx): break() var_sfx = _PRIVATE } -!isEmpty(using_privates):!no_private_qt_headers_warning:if(!debug_and_release|!build_pass) { +!isEmpty(using_privates):!no_private_qt_headers_warning:!build_pass { message("This project is using private headers and will therefore be tied to this specific Qt module build version.") message("Running this project against other versions of the Qt modules may crash at any arbitrary point.") message("This is not a bug, but a result of using Qt internals. You have been warned!") -- cgit v1.2.3 From a42c9cfc285a7b71b971a8aa000ca8d5216592ba Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 8 Jul 2016 19:09:49 +0200 Subject: generalize references to exclusive builds exclusive_builds_post.prf (via default_post.prf) processes debug_and_release into BUILDS, so .prfs which can rely on being executed later (because they are loaded via CONFIG) can rely on BUILDS and related variables. Change-Id: I5677079ad5145bf493af17b4b60347208572fd21 Reviewed-by: Jake Petroules Reviewed-by: Oswald Buddenhagen --- mkspecs/features/file_copies.prf | 3 +-- mkspecs/features/qt_docs_targets.prf | 2 +- mkspecs/features/resources.prf | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'mkspecs/features') diff --git a/mkspecs/features/file_copies.prf b/mkspecs/features/file_copies.prf index 6df294212c..4ebf41c78f 100644 --- a/mkspecs/features/file_copies.prf +++ b/mkspecs/features/file_copies.prf @@ -1,8 +1,7 @@ isEmpty(COPIES): return() contains(TEMPLATE, .*subdirs): error("COPIES does not work with TEMPLATE=subdirs") -build_pass:build_all: \ - debug_and_release:debug { +build_pass:build_all:!isEqual(BUILD_PASS, $$first(BUILDS)) { # Avoid that multiple build passes race with each other. # This will fail to copy anything if the user explicitly invokes # only the non-primary build. This is unfixable, as at qmake time diff --git a/mkspecs/features/qt_docs_targets.prf b/mkspecs/features/qt_docs_targets.prf index 1f9e2b0b47..9e96432462 100644 --- a/mkspecs/features/qt_docs_targets.prf +++ b/mkspecs/features/qt_docs_targets.prf @@ -30,7 +30,7 @@ contains(TEMPLATE, subdirs) { for(inst, DOC_TARGETS): \ prepareRecursiveTarget($$inst) } else { - debug_and_release:!build_pass { + !isEmpty(BUILDS):!build_pass { sub = $$first(BUILDS) for(inst, DOC_TARGETS) { $${inst}.CONFIG = recursive diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index 1f04c8b0d7..bc548ced05 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -35,7 +35,7 @@ for(resource, RESOURCES) { resource_file = $$RCC_DIR/qmake_$${resource}.qrc - !debug_and_release|build_pass { + isEmpty(BUILDS)|build_pass { # Collection of files, generate qrc file prefix = $$eval($${resource}.prefix) isEmpty(prefix): \ -- cgit v1.2.3