summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2020-10-26 16:08:56 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2020-11-28 15:02:58 (GMT)
commit3401403f69033446a5dcefd60dd8c375eaa58a44 (patch)
treef16f53fd7b8cdc0eb02a50bcc636cbf6f5a719e7 /Source/cmNinjaTargetGenerator.cxx
parenta97c41bf8b7748037b08d881b620285b64b1881f (diff)
downloadCMake-3401403f69033446a5dcefd60dd8c375eaa58a44.zip
CMake-3401403f69033446a5dcefd60dd8c375eaa58a44.tar.gz
CMake-3401403f69033446a5dcefd60dd8c375eaa58a44.tar.bz2
Refactoring: Introduce place-holder for dependency target.
These changes are in preparation of compiler generated dependencies support for Makefiles generators * compiler output and dependency target can be different for Makefiles generators * resolve inconsistency naming for dependency file place-holder
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 6085b25..4ac08e0 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -548,6 +548,7 @@ cmNinjaRule GetScanRule(
scanVars.Object = "$out"; // for RULE_LAUNCH_COMPILE
scanVars.PreprocessedSource = "$out";
scanVars.DependencyFile = rule.DepFile.c_str();
+ scanVars.DependencyTarget = "$out";
// Scanning needs the same preprocessor settings as direct compilation would.
scanVars.Source = vars.Source;
@@ -750,8 +751,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
const std::string flagsName = cmStrCat("CMAKE_DEPFILE_FLAGS_", lang);
std::string depfileFlags = mf->GetSafeDefinition(flagsName);
if (!depfileFlags.empty()) {
- cmSystemTools::ReplaceString(depfileFlags, "<DEPFILE>", "$DEP_FILE");
- cmSystemTools::ReplaceString(depfileFlags, "<OBJECT>", "$out");
+ cmSystemTools::ReplaceString(depfileFlags, "<DEP_FILE>", "$DEP_FILE");
+ cmSystemTools::ReplaceString(depfileFlags, "<DEP_TARGET>", "$out");
cmSystemTools::ReplaceString(
depfileFlags, "<CMAKE_C_COMPILER>",
cmToCStr(mf->GetDefinition("CMAKE_C_COMPILER")));