summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-01-13 16:58:07 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-01-13 16:58:07 (GMT)
commitca9100c5cea40cafe0d9a61f4263da2968dc50e0 (patch)
tree41e692415aa5fbe841bcc9dbf1bcfc9008386d3e
parent4bac5b628ea1e854ab23b6e713ad3eb211b3a9e3 (diff)
downloadCMake-ca9100c5cea40cafe0d9a61f4263da2968dc50e0.zip
CMake-ca9100c5cea40cafe0d9a61f4263da2968dc50e0.tar.gz
CMake-ca9100c5cea40cafe0d9a61f4263da2968dc50e0.tar.bz2
Ninja Multi-Config: Improve error handling when not doing cross-config build
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt4
3 files changed, 11 insertions, 9 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index ea66e3d..922beb7 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1192,7 +1192,10 @@ void cmGlobalNinjaGenerator::WriteTargetAliases(std::ostream& os)
this->AppendTargetOutputs(ta.second.GeneratorTarget, build.ExplicitDeps,
ta.second.Config);
}
- this->WriteBuild(os, build);
+ this->WriteBuild(this->EnableCrossConfigBuild()
+ ? os
+ : *this->GetConfigFileStream(ta.second.Config),
+ build);
}
if (this->IsMultiConfig()) {
@@ -1259,7 +1262,10 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
}
}
// Write target
- this->WriteBuild(os, build);
+ this->WriteBuild(this->EnableCrossConfigBuild()
+ ? os
+ : *this->GetConfigFileStream(config),
+ build);
}
// Add shortcut target
@@ -1282,7 +1288,7 @@ void cmGlobalNinjaGenerator::WriteFolderTargets(std::ostream& os)
}
build.Outputs.front() = this->BuildAlias(
this->ConvertToNinjaPath(currentBinaryDir + "/all"), "all");
- this->WriteBuild(*this->GetCommonFileStream(), build);
+ this->WriteBuild(os, build);
}
}
}
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt
index 95f42be..fa8b462 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt
@@ -1,3 +1 @@
-^ninja: error: 'RelWithDebInfo/[^
-]*simplestatic[^
-]*', needed by 'all:RelWithDebInfo', missing and no known rule to make it$
+^ninja: error: unknown target 'all:RelWithDebInfo'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt
index 74191bb..1a1fe9e 100644
--- a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt
@@ -1,3 +1 @@
-^ninja: error: 'RelWithDebInfo/[^
-]*simplestatic[^
-]*', needed by 'simplestatic:RelWithDebInfo', missing and no known rule to make it$
+^ninja: error: unknown target 'simplestatic:RelWithDebInfo'$