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 <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-06-13 17:28:52 +02:00 committed by The Qt Project
parent 69554e4586
commit 13e01fda19
4 changed files with 13 additions and 12 deletions

View File

@ -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): \

View File

@ -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)
}

View File

@ -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}

View File

@ -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)
}