From 9e9ab61e2ff248cd7b0b702decd4f967cd7becdf Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 24 Jun 2021 18:42:53 +0900 Subject: 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. --- Source/cmGlobalGenerator.cxx | 5 ++--- Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt | 2 +- 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 const& importedMap) { if (targetTypes == AllTargets) { - for (auto& target : mf->GetTargets()) { - cmTarget* t = &target.second; - lg->AddGeneratorTarget(cm::make_unique(t, lg)); + for (cmTarget* target : mf->GetOrderedTargets()) { + lg->AddGeneratorTarget(cm::make_unique(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. -- cgit v0.12