summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-01-07 16:03:25 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-01-07 16:26:17 (GMT)
commit98805a11ce8010810b9be89a019841752f6b34f4 (patch)
treeff59ce61bb1c6eccc82295aaee3f09c06d544787 /Source/cmLocalNinjaGenerator.cxx
parent1c9b61c23edb8200400ac77585f94ccd9fe0e58f (diff)
downloadCMake-98805a11ce8010810b9be89a019841752f6b34f4.zip
CMake-98805a11ce8010810b9be89a019841752f6b34f4.tar.gz
CMake-98805a11ce8010810b9be89a019841752f6b34f4.tar.bz2
Ninja Multi-Config: Run POST_BUILD when BYPRODUCTS don't overlap
Fixes: #21252
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 5a747e5..7229101 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -693,13 +693,11 @@ void cmLocalNinjaGenerator::WriteCustomCommandBuildStatement(
}
}
-namespace {
-bool HasUniqueByproducts(cmLocalGenerator& lg,
- std::vector<std::string> const& byproducts,
- cmListFileBacktrace const& bt)
+bool cmLocalNinjaGenerator::HasUniqueByproducts(
+ std::vector<std::string> const& byproducts, cmListFileBacktrace const& bt)
{
std::vector<std::string> configs =
- lg.GetMakefile()->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
+ this->GetMakefile()->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig);
cmGeneratorExpression ge(bt);
for (std::string const& p : byproducts) {
if (cmGeneratorExpression::Find(p) == std::string::npos) {
@@ -709,7 +707,7 @@ bool HasUniqueByproducts(cmLocalGenerator& lg,
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(p);
for (std::string const& config : configs) {
for (std::string const& b :
- lg.ExpandCustomCommandOutputPaths(*cge, config)) {
+ this->ExpandCustomCommandOutputPaths(*cge, config)) {
if (!seen.insert(b).second) {
return false;
}
@@ -719,6 +717,7 @@ bool HasUniqueByproducts(cmLocalGenerator& lg,
return true;
}
+namespace {
bool HasUniqueOutputs(std::vector<cmCustomCommandGenerator> const& ccgs)
{
std::set<std::string> allOutputs;
@@ -746,7 +745,7 @@ std::string cmLocalNinjaGenerator::CreateUtilityOutput(
// In Ninja Multi-Config, we can only produce cross-config utility
// commands if all byproducts are per-config.
if (!this->GetGlobalGenerator()->IsMultiConfig() ||
- !HasUniqueByproducts(*this, byproducts, bt)) {
+ !this->HasUniqueByproducts(byproducts, bt)) {
return this->cmLocalGenerator::CreateUtilityOutput(targetName, byproducts,
bt);
}