summaryrefslogtreecommitdiff
path: root/Source/cmGlobalVisualStudio8Generator.cxx
diff options
context:
space:
mode:
authorAlexander Boczar <boczar@hotmail.com>2020-02-18 12:07:39 -0800
committerBrad King <brad.king@kitware.com>2020-02-25 10:24:23 -0500
commit7c944da75700a2f68879551a253093b73f2d7951 (patch)
tree75c9a3052e3e6056a43719440c789d887d531b0c /Source/cmGlobalVisualStudio8Generator.cxx
parent8625ffd939b3c74944f6da9652777f7ca137b856 (diff)
downloadcmake-7c944da75700a2f68879551a253093b73f2d7951.tar.gz
VS: Add target property to explicitly control solution deployment
Add a `VS_SOLUTION_DEPLOY` property to control solution deploy mark. Fixes: #20346
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx36
1 files changed, 22 insertions, 14 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 1c62fbd918..fa0e9354a1 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -275,23 +275,31 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
bool cmGlobalVisualStudio8Generator::NeedsDeploy(
cmGeneratorTarget const& target, const char* config) const
{
- cmStateEnums::TargetType type = target.GetType();
- bool noDeploy = DeployInhibited(target, config);
- return !noDeploy &&
- (type == cmStateEnums::EXECUTABLE ||
- type == cmStateEnums::SHARED_LIBRARY) &&
- this->TargetSystemSupportsDeployment();
-}
+ cmStateEnums::TargetType const type = target.GetType();
+ if (type != cmStateEnums::EXECUTABLE &&
+ type != cmStateEnums::SHARED_LIBRARY) {
+ // deployment only valid on executables and shared libraries.
+ return false;
+ }
-bool cmGlobalVisualStudio8Generator::DeployInhibited(
- cmGeneratorTarget const& target, const char* config) const
-{
- bool rVal = false;
- if (const char* prop = target.GetProperty("VS_NO_SOLUTION_DEPLOY")) {
- rVal = cmIsOn(
+ if (const char* prop = target.GetProperty("VS_SOLUTION_DEPLOY")) {
+ // If set, it dictates behavior
+ return cmIsOn(
cmGeneratorExpression::Evaluate(prop, target.LocalGenerator, config));
}
- return rVal;
+
+ // To be deprecated, disable deployment even if target supports it.
+ if (const char* prop = target.GetProperty("VS_NO_SOLUTION_DEPLOY")) {
+ if (cmIsOn(cmGeneratorExpression::Evaluate(prop, target.LocalGenerator,
+ config))) {
+ // If true, always disable deployment
+ return false;
+ }
+ }
+
+ // Legacy behavior, enabled deployment based on 'hard-coded' target
+ // platforms.
+ return this->TargetSystemSupportsDeployment();
}
bool cmGlobalVisualStudio8Generator::TargetSystemSupportsDeployment() const