diff options
author | Brad King <brad.king@kitware.com> | 2024-01-29 15:43:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-01-29 15:43:45 (GMT) |
commit | 28e89baa2262a44a9d733293d0a2563ae9e671ca (patch) | |
tree | 12261f7519709ec2a5984c5f4bd4ea01a51eb473 /Source | |
parent | d377ccbf672f4aba36131fed8151058ee0a97eed (diff) | |
parent | d0bedb217046e4fb79bff2c24b581d97451d0fd4 (diff) | |
download | CMake-28e89baa2262a44a9d733293d0a2563ae9e671ca.zip CMake-28e89baa2262a44a9d733293d0a2563ae9e671ca.tar.gz CMake-28e89baa2262a44a9d733293d0a2563ae9e671ca.tar.bz2 |
Merge topic 'autogen-makefile-depfile'
d0bedb2170 Autogen: Forward dependencies when both Makefile and DEPFILE are used
4deb9c41b8 cmQtAutoGenInitializer: Improve Const-correctness
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !9190
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index ff6be2a..aaf1817 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -72,7 +72,7 @@ unsigned int GetParallelCPUCount() return count; } -std::string FileProjectRelativePath(cmMakefile* makefile, +std::string FileProjectRelativePath(cmMakefile const* makefile, std::string const& fileName) { std::string res; @@ -1462,7 +1462,6 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() std::vector<std::string> dependencies( this->AutogenTarget.DependFiles.begin(), this->AutogenTarget.DependFiles.end()); - if (useDepfile) { // Create a custom command that generates a timestamp file and // has a depfile assigned. The depfile is created by JobDepFilesMergeT. @@ -1501,6 +1500,16 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() cc->SetEscapeOldStyle(false); cmTarget* timestampTarget = this->LocalGen->AddUtilityCommand( timestampTargetName, true, std::move(cc)); + auto const isMake = + this->GlobalGen->GetName().find("Make") != std::string::npos; + if (this->AutogenTarget.DependOrigin && isMake) { + for (BT<std::pair<std::string, bool>> const& depName : + this->GenTarget->GetUtilities()) { + timestampTarget->AddUtility(depName.Value.first, false, + this->Makefile); + } + } + this->LocalGen->AddGeneratorTarget( cm::make_unique<cmGeneratorTarget>(timestampTarget, this->LocalGen)); |