summaryrefslogtreecommitdiff
path: root/Source/cmGlobalVisualStudio8Generator.cxx
diff options
context:
space:
mode:
authorWil Stark <wil_stark@keysight.com>2019-02-19 15:02:34 -0800
committerBrad King <brad.king@kitware.com>2019-02-25 09:14:15 -0500
commit917c035ada212cec47f92b51449b554526119372 (patch)
tree0aac592abaa8f35ec58acf03a082514241260103 /Source/cmGlobalVisualStudio8Generator.cxx
parent7574e16096abe57d44cde4e6380a22d940cde98c (diff)
downloadcmake-917c035ada212cec47f92b51449b554526119372.tar.gz
VS: support suppressing deployment of selected targets
Add a `VS_NO_SOLUTION_DEPLOY` target property to explicitly specify for each target whether to suppress VS solution deployment of the generated target project. Fixes: #18953
Diffstat (limited to 'Source/cmGlobalVisualStudio8Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx31
1 files changed, 26 insertions, 5 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index f6db018ea8..f3e73d3e8e 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -273,7 +273,7 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
: this->GetPlatformName())
<< "\n";
}
- if (this->NeedsDeploy(target.GetType())) {
+ if (this->NeedsDeploy(target, dstConfig)) {
fout << "\t\t{" << guid << "}." << i << "|" << this->GetPlatformName()
<< ".Deploy.0 = " << dstConfig << "|"
<< (!platformMapping.empty() ? platformMapping
@@ -284,11 +284,32 @@ void cmGlobalVisualStudio8Generator::WriteProjectConfigurations(
}
bool cmGlobalVisualStudio8Generator::NeedsDeploy(
- cmStateEnums::TargetType type) const
+ cmGeneratorTarget const& target, const char* config) const
{
- bool needsDeploy =
- (type == cmStateEnums::EXECUTABLE || type == cmStateEnums::SHARED_LIBRARY);
- return this->TargetsWindowsCE() && needsDeploy;
+ cmStateEnums::TargetType type = target.GetType();
+ bool noDeploy = DeployInhibited(target, config);
+ return !noDeploy &&
+ (type == cmStateEnums::EXECUTABLE ||
+ type == cmStateEnums::SHARED_LIBRARY) &&
+ this->TargetSystemSupportsDeployment();
+}
+
+bool cmGlobalVisualStudio8Generator::DeployInhibited(
+ cmGeneratorTarget const& target, const char* config) const
+{
+ bool rVal = false;
+ if (const char* propStr = target.GetProperty("VS_NO_SOLUTION_DEPLOY")) {
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(propStr);
+ std::string prop = cge->Evaluate(target.LocalGenerator, config);
+ rVal = cmSystemTools::IsOn(prop);
+ }
+ return rVal;
+}
+
+bool cmGlobalVisualStudio8Generator::TargetSystemSupportsDeployment() const
+{
+ return this->TargetsWindowsCE();
}
bool cmGlobalVisualStudio8Generator::ComputeTargetDepends()