summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2021-06-24 09:42:53 (GMT)
committerBrad King <brad.king@kitware.com>2021-07-08 19:16:46 (GMT)
commit9e9ab61e2ff248cd7b0b702decd4f967cd7becdf (patch)
treeb01d87c5a2b6788fec64b3985fead6d4e6268917
parent8a812dde61e0c309184100ef5d80fb2047c7d6b0 (diff)
downloadCMake-9e9ab61e2ff248cd7b0b702decd4f967cd7becdf.zip
CMake-9e9ab61e2ff248cd7b0b702decd4f967cd7becdf.tar.gz
CMake-9e9ab61e2ff248cd7b0b702decd4f967cd7becdf.tar.bz2
cmGlobalGenerator: Process targets in a stable order
`cmMakefile::Targets` is meant for efficient lookup but does not have a stable order. Use `cmMakefile::OrderedTargets` instead.
-rw-r--r--Source/cmGlobalGenerator.cxx5
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt2
2 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5d3fdce..15a7304 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1781,9 +1781,8 @@ void cmGlobalGenerator::CreateGeneratorTargets(
std::map<cmTarget*, cmGeneratorTarget*> const& importedMap)
{
if (targetTypes == AllTargets) {
- for (auto& target : mf->GetTargets()) {
- cmTarget* t = &target.second;
- lg->AddGeneratorTarget(cm::make_unique<cmGeneratorTarget>(t, lg));
+ for (cmTarget* target : mf->GetOrderedTargets()) {
+ lg->AddGeneratorTarget(cm::make_unique<cmGeneratorTarget>(target, lg));
}
}
diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt
index 95fc5ca..39415af 100644
--- a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt
+++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt
@@ -1,3 +1,3 @@
-CMake Error: Bad parameter for VS_DPI_AWARE: Bar
CMake Error: Bad parameter for VS_DPI_AWARE: Foo
+CMake Error: Bad parameter for VS_DPI_AWARE: Bar
CMake Generate step failed. Build files cannot be regenerated correctly.