summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-09-04 20:09:41 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-05 18:32:45 (GMT)
commit0b82e68f2f52847e4c14f1b22e6ef537b42f415a (patch)
tree42ff6c24e7563c4d56fe25d2e1a00fcd8c6b2e96 /Source/cmVisualStudio10TargetGenerator.cxx
parentc4ab098097f4fe1bc85ee29c6de390dff435f63f (diff)
downloadCMake-0b82e68f2f52847e4c14f1b22e6ef537b42f415a.zip
CMake-0b82e68f2f52847e4c14f1b22e6ef537b42f415a.tar.gz
CMake-0b82e68f2f52847e4c14f1b22e6ef537b42f415a.tar.bz2
VS: Restore CMakeLists.txt references in each target
The custom command de-duplication added by commit v3.12.0-rc1~171^2 (VS: Generate a custom command only in the least dependent target, 2018-03-23) accidentally also applied to the `CMakeLists.txt` file reference we put in each target. This file reference comes with a custom command that has no dependencies and that is safe to run repeatedly across multiple targets (via internal stamp checking). Therefore it should be excluded from the de-duplication so that `CMakeLists.txt` references appear in all targets for human reference. Fixes: #18310
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index eff915b..f472d8a 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1207,7 +1207,11 @@ void cmVisualStudio10TargetGenerator::WriteCustomCommands(Elem& e0)
this->GeneratorTarget->GetName() != CMAKE_CHECK_BUILD_SYSTEM_TARGET) {
if (cmSourceFile const* sf =
this->LocalGenerator->CreateVCProjBuildRule()) {
- this->WriteCustomCommand(e0, sf);
+ // Write directly rather than through WriteCustomCommand because
+ // we do not want the de-duplication and it has no dependencies.
+ if (cmCustomCommand const* command = sf->GetCustomCommand()) {
+ this->WriteCustomRule(e0, sf, *command);
+ }
}
}
}