From 8bbd5db4c160927cf5e9a2eb2f45fe36a2c2d799 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Thu, 23 Jun 2016 17:01:29 +0200 Subject: [PATCH] Ninja: Make bundle resources a dependency of their target Fixes #13816. --- Source/cmNinjaTargetGenerator.cxx | 8 ++++++-- Source/cmNinjaTargetGenerator.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b413c33d5..954c73e0d 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -487,6 +487,10 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements() this->GetLocalGenerator()->AppendTargetDepends(this->GeneratorTarget, orderOnlyDeps); + // Add order-only dependencies on other files associated with the target. + orderOnlyDeps.insert(orderOnlyDeps.end(), this->ExtraFiles.begin(), + this->ExtraFiles.end()); + // Add order-only dependencies on custom command outputs. for (std::vector::const_iterator cci = this->CustomCommands.begin(); @@ -717,8 +721,8 @@ void cmNinjaTargetGenerator::MacOSXContentGeneratorType::operator()( this->Generator->GetGlobalGenerator()->WriteMacOSXContentBuild(input, output); - // Add as a dependency of all target so that it gets called. - this->Generator->GetGlobalGenerator()->AddDependencyToAll(output); + // Add as a dependency to the target so that it gets called. + this->Generator->ExtraFiles.push_back(output); } void cmNinjaTargetGenerator::addPoolNinjaVariable( diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index 414aa09c4..44346c1b0 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -156,6 +156,7 @@ private: /// List of object files for this target. cmNinjaDeps Objects; std::vector CustomCommands; + cmNinjaDeps ExtraFiles; }; #endif // ! cmNinjaTargetGenerator_h