From 659e9ae93722c26b3bd855e021fbad0a3b73af3b Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 27 Feb 2023 22:56:26 +0100 Subject: cmGlobalVisualStudio8Generator: Collect CMake input files earlier --- Source/cmGlobalVisualStudio8Generator.cxx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'Source/cmGlobalVisualStudio8Generator.cxx') diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 2aba46fe2c..7c5ad62376 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -262,6 +262,17 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() cmTarget* tgt = lg.AddUtilityCommand(CMAKE_CHECK_BUILD_SYSTEM_TARGET, false, std::move(cc)); + // Collect the input files used to generate all targets in this + // project. + std::vector listFiles; + for (const auto& gen : generators) { + cm::append(listFiles, gen->GetMakefile()->GetListFiles()); + } + // Sort the list of input files and remove duplicates. + std::sort(listFiles.begin(), listFiles.end(), std::less()); + auto new_end = std::unique(listFiles.begin(), listFiles.end()); + listFiles.erase(new_end, listFiles.end()); + auto ptr = cm::make_unique(tgt, &lg); auto* gt = ptr.get(); lg.AddGeneratorTarget(std::move(ptr)); @@ -295,13 +306,6 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() // The custom rule runs cmake so set UTF-8 pipes. bool stdPipesUTF8 = true; - // Collect the input files used to generate all targets in this - // project. - std::vector listFiles; - for (const auto& gen : generators) { - cm::append(listFiles, gen->GetMakefile()->GetListFiles()); - } - // Add a custom prebuild target to run the VerifyGlobs script. cmake* cm = this->GetCMakeInstance(); if (cm->DoWriteGlobVerifyTarget()) { @@ -325,11 +329,6 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget() listFiles.push_back(cm->GetGlobVerifyStamp()); } - // Sort the list of input files and remove duplicates. - std::sort(listFiles.begin(), listFiles.end(), std::less()); - auto new_end = std::unique(listFiles.begin(), listFiles.end()); - listFiles.erase(new_end, listFiles.end()); - // Create a rule to re-run CMake. std::string argS = cmStrCat("-S", lg.GetSourceDirectory()); std::string argB = cmStrCat("-B", lg.GetBinaryDirectory()); -- cgit v1.2.1