aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/qbs/modules/Exporter/pkgconfig/pkgconfig.qbs7
-rw-r--r--share/qbs/modules/Exporter/qbs/qbsexporter.qbs4
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp26
3 files changed, 31 insertions, 6 deletions
diff --git a/share/qbs/modules/Exporter/pkgconfig/pkgconfig.qbs b/share/qbs/modules/Exporter/pkgconfig/pkgconfig.qbs
index 5fbda2bf4..aecad6126 100644
--- a/share/qbs/modules/Exporter/pkgconfig/pkgconfig.qbs
+++ b/share/qbs/modules/Exporter/pkgconfig/pkgconfig.qbs
@@ -32,11 +32,8 @@ Module {
requiresInputs: false
// Make sure all relevant library artifacts have been created by the time we run.
- inputsFromDependencies: autoDetect
- ? ["Exporter.pkgconfig.pc", "staticlibrary", "dynamiclibrary"]
- : []
- inputs: {
- if (!product.Exporter.pkgconfig.autoDetect)
+ auxiliaryInputs: {
+ if (!autoDetect)
return undefined;
if (product.type.contains("staticlibrary"))
return ["staticlibrary"];
diff --git a/share/qbs/modules/Exporter/qbs/qbsexporter.qbs b/share/qbs/modules/Exporter/qbs/qbsexporter.qbs
index 6cdc55891..351edfefe 100644
--- a/share/qbs/modules/Exporter/qbs/qbsexporter.qbs
+++ b/share/qbs/modules/Exporter/qbs/qbsexporter.qbs
@@ -49,7 +49,9 @@ Module {
requiresInputs: false
// Make sure we only run when all other artifacts are already present.
- inputs: product.type.filter(function(t) { return t !== "Exporter.qbs.module"; })
+ // TODO: This also matches target artifacts in dependencies. Should not hurt,
+ // but might be a hint that we should have auxiliaryInputsFromDependencies.
+ auxiliaryInputs: product.type.filter(function(t) { return t !== "Exporter.qbs.module"; })
Artifact {
filePath: product.Exporter.qbs.fileName
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 83c00fa2f..f9033ed09 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -3365,6 +3365,8 @@ void TestBlackbox::exportsPkgconfig()
{
QDir::setCurrent(testDataDir + "/exports-pkgconfig");
QCOMPARE(runQbs(), 0);
+ QVERIFY2(m_qbsStdout.contains("Creating TheFirstLib.pc"), m_qbsStdout.constData());
+ QVERIFY2(m_qbsStdout.contains("Creating TheSecondLib.pc"), m_qbsStdout.constData());
QFile sourcePcFile(HostOsInfo::isWindowsHost() ? "TheFirstLib_windows.pc" : "TheFirstLib.pc");
QString generatedPcFilePath = relativeProductBuildDir("TheFirstLib") + "/TheFirstLib.pc";
QFile generatedPcFile(generatedPcFilePath);
@@ -3379,6 +3381,12 @@ void TestBlackbox::exportsPkgconfig()
QVERIFY2(sourcePcFile.open(QIODevice::ReadOnly), qPrintable(sourcePcFile.errorString()));
QVERIFY2(generatedPcFile.open(QIODevice::ReadOnly), qPrintable(generatedPcFile.errorString()));
QCOMPARE(generatedPcFile.readAll(), sourcePcFile.readAll());
+ WAIT_FOR_NEW_TIMESTAMP();
+ touch("firstlib.cpp");
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(m_qbsStdout.contains("linking"), m_qbsStdout.constData());
+ QVERIFY2(!m_qbsStdout.contains("Creating TheFirstLib.pc"), m_qbsStdout.constData());
+ QVERIFY2(!m_qbsStdout.contains("Creating TheSecondLib.pc"), m_qbsStdout.constData());
}
void TestBlackbox::exportsQbs()
@@ -3431,6 +3439,24 @@ void TestBlackbox::exportsQbs()
QCOMPARE(runQbs(QStringList({"-p", "MyTool"})), 0);
QVERIFY2(!m_qbsStdout.contains("Creating MyTool.qbs"), m_qbsStdout.constData());
+ // Rebuilding the target binary should not cause recreating the module file.
+ WAIT_FOR_NEW_TIMESTAMP();
+ touch("mylib.cpp");
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(m_qbsStdout.count("linking") >= 2, m_qbsStdout.constData());
+ QVERIFY2(!m_qbsStdout.contains("Creating MyLib"), m_qbsStdout.constData());
+ QVERIFY2(!m_qbsStdout.contains("Creating MyTool.qbs"), m_qbsStdout.constData());
+
+ // Changing a setting that influences the name of a target artifact should cause
+ // recreating the module file.
+ const QbsRunParameters resolveParams("resolve", QStringList{"-f", "exports-qbs.qbs",
+ "modules.cpp.dynamicLibrarySuffix:blubb"});
+ QCOMPARE(runQbs(resolveParams), 0);
+ QCOMPARE(runQbs(), 0);
+ QVERIFY2(m_qbsStdout.count("linking") >= 2, m_qbsStdout.constData());
+ QVERIFY2(m_qbsStdout.count("Creating MyLib") == 2, m_qbsStdout.constData());
+ QVERIFY2(!m_qbsStdout.contains("Creating MyTool.qbs"), m_qbsStdout.constData());
+
// Change tracking for accesses to product.exports (positive).
WAIT_FOR_NEW_TIMESTAMP();
REPLACE_IN_FILE("tool.qbs", "product.toolTags", "[]");