diff options
author | Brad King <brad.king@kitware.com> | 2021-02-24 14:44:54 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-02-24 14:44:59 (GMT) |
commit | ab3485d15b2741746c97d1718484a58de03f219d (patch) | |
tree | 813d8ddcfb2894632050191aef214084a23ee3b2 /Source/cmQtAutoGenInitializer.cxx | |
parent | 16a2c0cfa3ba00ade705e88c87824e8d4b5a14bf (diff) | |
parent | 339dbc901f04369e997d8d65b60380d6255e5f10 (diff) | |
download | CMake-ab3485d15b2741746c97d1718484a58de03f219d.zip CMake-ab3485d15b2741746c97d1718484a58de03f219d.tar.gz CMake-ab3485d15b2741746c97d1718484a58de03f219d.tar.bz2 |
Merge topic 'autogen-cmp0116-fix'
339dbc901f Help: Note that CMP0116 is recorded at the time of CC creation
e3740e020e Tests: Test Qt autogen target with CMP0116 set to WARN
cf34011ce7 Tests: Test per-CC behavior of CMP0116
3a95503512 Ninja: Use CMP0116 status recorded at time of custom command's creation
f01f10e8fb cmCustomCommand: Record value of CMP0116 at time of creation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5848
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 39 |
1 files changed, 11 insertions, 28 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index ba6c1c5..d4138d9 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -30,7 +30,6 @@ #include "cmGeneratorExpression.h" #include "cmGeneratorTarget.h" #include "cmGlobalGenerator.h" -#include "cmGlobalNinjaGenerator.h" #include "cmLinkItem.h" #include "cmListFileCache.h" #include "cmLocalGenerator.h" @@ -1226,7 +1225,8 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() cmTarget* timestampTarget = this->LocalGen->AddUtilityCommand( timestampTargetName, true, this->Dir.Work.c_str(), /*byproducts=*/timestampTargetProvides, - /*depends=*/dependencies, timestampTargetCommandLines, false, nullptr); + /*depends=*/dependencies, timestampTargetCommandLines, cmPolicies::NEW, + false, nullptr); this->LocalGen->AddGeneratorTarget( cm::make_unique<cmGeneratorTarget>(timestampTarget, this->LocalGen)); @@ -1257,27 +1257,8 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() const std::string outputFile = cmStrCat(this->Dir.Build, "/", timestampFileName); this->AutogenTarget.DepFile = cmStrCat(this->Dir.Build, "/deps"); - std::string relativeBinaryDir; - if (dynamic_cast<cmGlobalNinjaGenerator*>(this->GlobalGen)) { - switch (this->LocalGen->GetPolicyStatus(cmPolicies::CMP0116)) { - case cmPolicies::OLD: - case cmPolicies::WARN: - relativeBinaryDir = cmSystemTools::RelativePath( - this->LocalGen->GetBinaryDirectory(), - this->LocalGen->GetCurrentBinaryDirectory()); - if (!relativeBinaryDir.empty()) { - relativeBinaryDir = cmStrCat(relativeBinaryDir, "/"); - } - break; - case cmPolicies::REQUIRED_IF_USED: - case cmPolicies::REQUIRED_ALWAYS: - case cmPolicies::NEW: - break; - } - } this->AutogenTarget.DepFileRuleName = - cmStrCat(relativeBinaryDir, this->GenTarget->GetName(), "_autogen/", - timestampFileName); + cmStrCat(this->GenTarget->GetName(), "_autogen/", timestampFileName); commandLines.push_back(cmMakeCommandLine( { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile })); @@ -1285,7 +1266,8 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() const std::string no_main_dependency; this->LocalGen->AddCustomCommandToOutput( outputFile, dependencies, no_main_dependency, commandLines, - autogenComment.c_str(), this->Dir.Work.c_str(), /*replace=*/false, + autogenComment.c_str(), this->Dir.Work.c_str(), + /*cmp0116=*/cmPolicies::NEW, /*replace=*/false, /*escapeOldStyle=*/false, /*uses_terminal=*/false, /*command_expand_lists=*/false, this->AutogenTarget.DepFile, "", @@ -1303,7 +1285,8 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() cmTarget* autogenTarget = this->LocalGen->AddUtilityCommand( this->AutogenTarget.Name, true, this->Dir.Work.c_str(), /*byproducts=*/autogenByproducts, - /*depends=*/dependencies, commandLines, false, autogenComment.c_str()); + /*depends=*/dependencies, commandLines, cmPolicies::NEW, false, + autogenComment.c_str()); // Create autogen generator target this->LocalGen->AddGeneratorTarget( cm::make_unique<cmGeneratorTarget>(autogenTarget, this->LocalGen)); @@ -1389,8 +1372,8 @@ bool cmQtAutoGenInitializer::InitRccTargets() cmTarget* autoRccTarget = this->LocalGen->AddUtilityCommand( ccName, true, this->Dir.Work.c_str(), ccOutput, ccDepends, - commandLines, false, ccComment.c_str(), false, false, "", - stdPipesUTF8); + commandLines, cmPolicies::NEW, false, ccComment.c_str(), false, + false, "", stdPipesUTF8); // Create autogen generator target this->LocalGen->AddGeneratorTarget( @@ -1430,8 +1413,8 @@ bool cmQtAutoGenInitializer::InitRccTargets() this->LocalGen->AddCustomCommandToOutput( ccOutput, ccByproducts, ccDepends, no_main_dependency, no_implicit_depends, commandLines, ccComment.c_str(), - this->Dir.Work.c_str(), false, true, false, false, "", "", - stdPipesUTF8); + this->Dir.Work.c_str(), cmPolicies::NEW, false, true, false, false, + "", "", stdPipesUTF8); } // Reconfigure when .qrc file changes this->Makefile->AddCMakeDependFile(qrc.QrcFile); |