From 13e01fda195bcf55e3fb1862c9467ac9cbbf33c1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Jun 2013 17:28:52 +0200 Subject: assemble the tool commands at use time, after all the precise syntax depends on what exactly the command is used for, so we need to resolve it at the last moment. see followup commits. This logically reverts commits 6f4ff81380862ad0e788151b35d742f548241d5a and 731e6bece5cebe205ca47c1c078c7ac18984ba1c. Change-Id: If285c91d7521069be86d32593b5c2ae2027b3038 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_functions.prf | 8 ++++---- mkspecs/features/qt_tool.prf | 11 ++++++----- mkspecs/features/testcase.prf | 2 +- qtbase.pro | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 9ec22d57db..4b96c48aa5 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -191,7 +191,7 @@ defineTest(qtAddRpathLink) { # variable, default defineTest(qtPrepareTool) { - $$1 = $$eval(QT_TOOL.$${2}.command) + $$1 = $$eval(QT_TOOL.$${2}.binary) isEmpty($$1) { $$1 = $$[QT_HOST_BINS]/$$2 exists($$eval($$1).pl) { @@ -204,9 +204,9 @@ defineTest(qtPrepareTool) { $$1 = $$BUNDLENAME } } - $$1 = $$shell_path($$eval($$1)) } - export($$1) + $$1 = $$shell_path($$eval($$1)) + qtAddTargetEnv($$1, QT_TOOL.$${2}.depends) } defineTest(qtAddToolEnv) { @@ -233,7 +233,7 @@ defineTest(qtAddToolEnv) { } defineTest(qtAddTargetEnv) { - deps = $$replace(QT, -private$, ) + deps = $$replace($$2, -private$, ) deps = $$resolve_depends(deps, "QT.", ".depends" ".private_depends" ".run_depends") !isEmpty(deps) { for(dep, deps): \ diff --git a/mkspecs/features/qt_tool.prf b/mkspecs/features/qt_tool.prf index 0a588807c8..9a6b9634e0 100644 --- a/mkspecs/features/qt_tool.prf +++ b/mkspecs/features/qt_tool.prf @@ -19,17 +19,17 @@ CONFIG += console !build_pass:if(!host_build|!force_bootstrap|force_independent) { isEmpty(MODULE):MODULE = $$TARGET - MODULE_DEPENDS = $$replace(QT, -private$, ) + !host_build|!force_bootstrap: MODULE_DEPENDS = $$replace(QT, -private$, ) load(qt_build_paths) load(resolve_target) - cmd = $$shell_path($$QMAKE_RESOLVED_TARGET) - !host_build|!force_bootstrap: qtAddTargetEnv(cmd) TOOL_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_tool_$${MODULE}.pri - TOOL_PRI_CONT = "QT_TOOL.$${MODULE}.command = $$val_escape(cmd)" + TOOL_PRI_CONT = \ + "QT_TOOL.$${MODULE}.binary = $$QMAKE_RESOLVED_TARGET" \ + "QT_TOOL.$${MODULE}.depends =$$join(MODULE_DEPENDS, " ", " ")" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -39,6 +39,7 @@ CONFIG += console unset(added) } include($$TOOL_PRI) - cache(QT_TOOL.$${MODULE}.command, transient) + for(var, $$list(binary depends)): \ + cache(QT_TOOL.$${MODULE}.$$var, transient) } diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 15febe2dd5..e31d1f4539 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -43,7 +43,7 @@ else: check.commands += $(DESTDIR_TARGET) check.commands += $(TESTARGS) # Add environment for non-installed builds -qtAddTargetEnv(check.commands) +qtAddTargetEnv(check.commands, QT) # If the test is marked as insignificant, discard the exit code insignificant_test:check.commands = -$${check.commands} diff --git a/qtbase.pro b/qtbase.pro index 02dc11eac2..6ab032e30f 100644 --- a/qtbase.pro +++ b/qtbase.pro @@ -88,7 +88,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { TOOL_PRI = $$OUT_PWD/mkspecs/modules/qt_tool_syncqt.pri - TOOL_PRI_CONT = "QT_TOOL.syncqt.command = $$val_escape(cmd)" + TOOL_PRI_CONT = "QT_TOOL.syncqt.binary = $$val_escape(cmd)" write_file($$TOOL_PRI, TOOL_PRI_CONT)|error("Aborting.") # Then, inject the new tool into the current cache state @@ -97,7 +97,7 @@ prefix_build|!equals(PWD, $$OUT_PWD) { cache(QMAKE_INTERNAL_INCLUDED_FILES, add transient, added) } include($$TOOL_PRI) - cache(QT_TOOL.syncqt.command, transient) + cache(QT_TOOL.syncqt.binary, transient) } -- cgit v1.2.3