summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-26 12:41:18 (GMT)
committerBrad King <brad.king@kitware.com>2018-04-26 12:41:18 (GMT)
commita92ee4e30d57ef957a7a2ff4e0d5066136a2f6c2 (patch)
treef34801afd9a8469d36c02944435bcfe8103fade2
parentb58e41ccbd606106ee581943c8af92f8bfd5d535 (diff)
parent0826c20128fad20aafac2006ac0371e381e3cf60 (diff)
downloadCMake-a92ee4e30d57ef957a7a2ff4e0d5066136a2f6c2.zip
CMake-a92ee4e30d57ef957a7a2ff4e0d5066136a2f6c2.tar.gz
CMake-a92ee4e30d57ef957a7a2ff4e0d5066136a2f6c2.tar.bz2
Merge branch 'backport-ninja-issue-17942' into release-3.11
Merge-request: !2010
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx6
-rw-r--r--Source/cmNinjaTargetGenerator.cxx4
2 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index c544141..99b9261 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -105,8 +105,14 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
lg, config, false, nullptr, nullptr, nullptr, le);
cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(
name, false, cmSourceFileLocationKind::Known);
+ // Tell TraceDependencies that the file is not expected to exist
+ // on disk yet. We generate it after that runs.
sf->SetProperty("GENERATED", "1");
+ // Tell the build system generators that there is no build rule
+ // to generate the file.
+ sf->SetProperty("__CMAKE_GENERATED_BY_CMAKE", "1");
+
gg->SetFilenameTargetDepends(
sf, this->OutputFileExpr->GetSourceSensitiveTargets());
}
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index f4faf47..a6a3efb 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -896,7 +896,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// (either attached to this source file or another one), assume that one of
// the target dependencies, OBJECT_DEPENDS or header file custom commands
// will rebuild the file.
- if (source->GetPropertyAsBool("GENERATED") && !source->GetCustomCommand() &&
+ if (source->GetPropertyAsBool("GENERATED") &&
+ !source->GetPropertyAsBool("__CMAKE_GENERATED_BY_CMAKE") &&
+ !source->GetCustomCommand() &&
!this->GetGlobalGenerator()->HasCustomCommandOutput(sourceFileName)) {
this->GetGlobalGenerator()->AddAssumedSourceDependencies(sourceFileName,
orderOnlyDeps);