summaryrefslogtreecommitdiff
path: root/Source/cmGlobalVisualStudio8Generator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2023-02-27 22:56:26 +0100
committerBrad King <brad.king@kitware.com>2023-04-25 16:48:41 -0400
commit659e9ae93722c26b3bd855e021fbad0a3b73af3b (patch)
tree73e1aa6b687eb475276234d9a6ba82a37f67044c /Source/cmGlobalVisualStudio8Generator.cxx
parent827d5b75d47126205faba26cabc8856c6d9c3362 (diff)
downloadcmake-659e9ae93722c26b3bd855e021fbad0a3b73af3b.tar.gz
cmGlobalVisualStudio8Generator: Collect CMake input files earlier
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx23
1 files changed, 11 insertions, 12 deletions
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<std::string> 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<std::string>());
+ auto new_end = std::unique(listFiles.begin(), listFiles.end());
+ listFiles.erase(new_end, listFiles.end());
+
auto ptr = cm::make_unique<cmGeneratorTarget>(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<std::string> 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<std::string>());
- 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());