diff options
author | Wil Stark <wil_stark@keysight.com> | 2019-02-19 23:02:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-25 14:14:15 (GMT) |
commit | 917c035ada212cec47f92b51449b554526119372 (patch) | |
tree | 0aac592abaa8f35ec58acf03a082514241260103 /Source/cmGlobalVisualStudio8Generator.cxx | |
parent | 7574e16096abe57d44cde4e6380a22d940cde98c (diff) | |
download | CMake-917c035ada212cec47f92b51449b554526119372.zip CMake-917c035ada212cec47f92b51449b554526119372.tar.gz CMake-917c035ada212cec47f92b51449b554526119372.tar.bz2 |
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.cxx | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index f6db018..f3e73d3 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() |