summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudio7Generator.cxx
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2021-12-12 06:01:20 (GMT)
committerBrad King <brad.king@kitware.com>2021-12-14 15:48:43 (GMT)
commit780341f360773d7b3b766b835bd539f46397e0a6 (patch)
tree767cdbaa73a9b9c7c38a31ab962034f1386d918f /Source/cmLocalVisualStudio7Generator.cxx
parenta6fa3fa136c291c36aefbc79b62995a63bf9107b (diff)
downloadCMake-780341f360773d7b3b766b835bd539f46397e0a6.zip
CMake-780341f360773d7b3b766b835bd539f46397e0a6.tar.gz
CMake-780341f360773d7b3b766b835bd539f46397e0a6.tar.bz2
cmCustomCommand: Track main dependency explicitly
Store the main dependency as the first entry in the dependency list plus a boolean member indicating its existence. Note that this slightly changes existing behavior: the main dependency was previously the last entry of the dependency list.
Diffstat (limited to 'Source/cmLocalVisualStudio7Generator.cxx')
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index c40e33e..dc9dcc7 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -129,7 +129,6 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
if (l->GetType() == cmStateEnums::GLOBAL_TARGET) {
cmCustomCommandLines force_commands =
cmMakeSingleCommandLine({ "cd", "." });
- std::string no_main_dependency;
std::string force = cmStrCat(this->GetCurrentBinaryDirectory(),
"/CMakeFiles/", l->GetName(), "_force");
if (cmSourceFile* sf =
@@ -141,8 +140,8 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
cc->SetCommandLines(force_commands);
cc->SetComment(" ");
cc->SetCMP0116Status(cmPolicies::NEW);
- if (cmSourceFile* file = this->AddCustomCommandToOutput(
- no_main_dependency, std::move(cc), true)) {
+ if (cmSourceFile* file =
+ this->AddCustomCommandToOutput(std::move(cc), true)) {
l->AddSource(file->ResolveFullPath());
}
}
@@ -266,13 +265,14 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
std::string comment = cmStrCat("Building Custom Rule ", makefileIn);
auto cc = cm::make_unique<cmCustomCommand>();
cc->SetOutputs(stampName);
+ cc->SetMainDependency(makefileIn);
cc->SetDepends(listFiles);
cc->SetCommandLines(commandLines);
cc->SetComment(comment.c_str());
cc->SetCMP0116Status(cmPolicies::NEW);
cc->SetEscapeOldStyle(false);
cc->SetStdPipesUTF8(true);
- this->AddCustomCommandToOutput(makefileIn, std::move(cc), true);
+ this->AddCustomCommandToOutput(std::move(cc), true);
if (cmSourceFile* file = this->Makefile->GetSource(makefileIn)) {
// Finalize the source file path now since we're adding this after
// the generator validated all project-named sources.