summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-07-10 13:02:47 (GMT)
committerOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2024-07-10 13:22:02 (GMT)
commit9ffac91e37988a6bd57440dc7986d1ea0a1a5bc7 (patch)
tree6e229dad39a6c0eaaec9156e4829a107d97cb516
parente9fa1a3a183c4f3a5feb75975e97571563ffa5ae (diff)
downloadCMake-9ffac91e37988a6bd57440dc7986d1ea0a1a5bc7.zip
CMake-9ffac91e37988a6bd57440dc7986d1ea0a1a5bc7.tar.gz
CMake-9ffac91e37988a6bd57440dc7986d1ea0a1a5bc7.tar.bz2
Autogen: Revert "Add timestamp file for CMAKE_GLOBAL_AUTORCC_TARGET"
In the commit 8d99e71b, a new timestamp file was added to prevent unneeded `AUTORCC` triggering after successful builds when `CMAKE_GLOBAL_AUTORCC_TARGET` is ON. This caused a regression that configuration fails when multiple `.qrc` files are added to a target. This commits reverts 8d99e71b. Issue: #26059 Fixes: #26126
-rw-r--r--Source/cmQtAutoGenInitializer.cxx44
-rw-r--r--Tests/RunCMake/Autogen_5/RunCMakeTest.cmake16
2 files changed, 7 insertions, 53 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index d646cce..c95be77 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1673,43 +1673,13 @@ bool cmQtAutoGenInitializer::InitRccTargets()
if (!qrc.Unique) {
ccName += cmStrCat('_', qrc.QrcPathChecksum);
}
- cmTarget* autoRccTarget = nullptr;
- // When CMAKE_GLOBAL_AUTORCC_TARGET is ON and qrc is not generated,
- // Add generate a timestamp file and a custom command to touch it.
- // This will ensure that the global autorcc target is run only when the
- // qrc file changes.
- if (!qrc.Generated && this->Rcc.GlobalTarget) {
- cm::string_view const timestampFileName = "global_rcc_timestamp";
- auto const outputFile =
- cmStrCat(this->Dir.Build, "/", timestampFileName);
- commandLines.push_back(cmMakeCommandLine(
- { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
- cc->SetByproducts(ccOutput);
- cc->SetDepends(ccDepends);
- cc->SetEscapeOldStyle(false);
- cc->SetOutputs(outputFile);
- cc->SetCommandLines(commandLines);
- this->LocalGen->AddCustomCommandToOutput(std::move(cc));
- this->AddGeneratedSource(outputFile, this->Rcc);
- ccDepends.clear();
- ccDepends.push_back(outputFile);
-
- auto ccRccTarget = cm::make_unique<cmCustomCommand>();
- ccRccTarget->SetWorkingDirectory(this->Dir.Work.c_str());
- ccRccTarget->SetComment(ccComment.c_str());
- ccRccTarget->SetStdPipesUTF8(true);
- ccRccTarget->SetDepends(ccDepends);
- ccRccTarget->SetEscapeOldStyle(false);
-
- autoRccTarget = this->LocalGen->AddUtilityCommand(
- ccName, true, std::move(ccRccTarget));
- } else {
- cc->SetByproducts(ccOutput);
- cc->SetDepends(ccDepends);
- cc->SetEscapeOldStyle(false);
- autoRccTarget =
- this->LocalGen->AddUtilityCommand(ccName, true, std::move(cc));
- }
+
+ cc->SetByproducts(ccOutput);
+ cc->SetDepends(ccDepends);
+ cc->SetEscapeOldStyle(false);
+ cmTarget* autoRccTarget =
+ this->LocalGen->AddUtilityCommand(ccName, true, std::move(cc));
+
// Create autogen generator target
this->LocalGen->AddGeneratorTarget(
cm::make_unique<cmGeneratorTarget>(autoRccTarget, this->LocalGen));
diff --git a/Tests/RunCMake/Autogen_5/RunCMakeTest.cmake b/Tests/RunCMake/Autogen_5/RunCMakeTest.cmake
index 1f6f7d4..8060ec4 100644
--- a/Tests/RunCMake/Autogen_5/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Autogen_5/RunCMakeTest.cmake
@@ -27,21 +27,5 @@ if (DEFINED with_qt_version)
endblock()
endforeach()
endif()
- if (RunCMake_GENERATOR MATCHES "Ninja")
- block()
- set(RunCMake_TEST_BINARY_DIR
- ${RunCMake_BINARY_DIR}/RccGlobalAutoRcc-build)
- run_cmake_with_options(RccExample ${RunCMake_TEST_OPTIONS}
- -DCMAKE_GLOBAL_AUTORCC_TARGET=ON)
- set(RunCMake_TEST_NO_CLEAN 1)
- set(RunCMake_TEST_VARIANT_DESCRIPTION "-First-build")
- run_cmake_command(RccGlobalAutoRcc-build ${CMAKE_COMMAND}
- --build . --config Debug)
- set(RunCMake_TEST_VARIANT_DESCRIPTION "-Second-build-nothing-to-do")
- set(RunCMake_TEST_NOT_EXPECT_stdout "Automatic RCC for data.qrc")
- run_cmake_command(RccGlobalAutoRcc-build ${CMAKE_COMMAND}
- --build . --config Debug)
- endblock()
- endif()
endif()
endif ()