diff options
author | Brad King <brad.king@kitware.com> | 2019-02-26 16:10:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-02-26 16:10:08 (GMT) |
commit | 2621efac19e0538f0f92f69ecab60db184c70953 (patch) | |
tree | 2c5c4d365ee1d17b89a9263bcd1350457be9bd22 /Source | |
parent | 28a296b6c43f87e6b148c2207062fcc9a09961a1 (diff) | |
parent | 917c035ada212cec47f92b51449b554526119372 (diff) | |
download | CMake-2621efac19e0538f0f92f69ecab60db184c70953.zip CMake-2621efac19e0538f0f92f69ecab60db184c70953.tar.gz CMake-2621efac19e0538f0f92f69ecab60db184c70953.tar.bz2 |
Merge topic 'vs-wince-no-deploy'
917c035ada VS: support suppressing deployment of selected targets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2991
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 11 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 31 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.h | 10 |
4 files changed, 40 insertions, 16 deletions
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index 4eb78ba..4b74ef1 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -252,15 +252,10 @@ cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs() return ret; } -bool cmGlobalVisualStudio11Generator::NeedsDeploy( - cmStateEnums::TargetType type) const +bool cmGlobalVisualStudio11Generator::TargetSystemSupportsDeployment() const { - if ((type == cmStateEnums::EXECUTABLE || - type == cmStateEnums::SHARED_LIBRARY) && - (this->SystemIsWindowsPhone || this->SystemIsWindowsStore)) { - return true; - } - return cmGlobalVisualStudio10Generator::NeedsDeploy(type); + return this->SystemIsWindowsPhone || this->SystemIsWindowsStore || + cmGlobalVisualStudio10Generator::TargetSystemSupportsDeployment(); } bool cmGlobalVisualStudio11Generator::IsWindowsDesktopToolsetInstalled() const diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h index 8b4c8b7..f8cce18 100644 --- a/Source/cmGlobalVisualStudio11Generator.h +++ b/Source/cmGlobalVisualStudio11Generator.h @@ -45,8 +45,8 @@ protected: bool UseFolderProperty() const override; static std::set<std::string> GetInstalledWindowsCESDKs(); - /** Return true if the configuration needs to be deployed */ - bool NeedsDeploy(cmStateEnums::TargetType type) const override; + /** Return true if target system supports debugging deployment. */ + bool TargetSystemSupportsDeployment() const override; private: class Factory; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index ceb56d1..21abdf7 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() diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 8719bf3..75f4778 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -54,7 +54,15 @@ protected: bool AddCheckTarget(); /** Return true if the configuration needs to be deployed */ - virtual bool NeedsDeploy(cmStateEnums::TargetType type) const; + virtual bool NeedsDeploy(cmGeneratorTarget const& target, + const char* config) const; + + /** Returns true if deployment has been disabled in cmake file. */ + bool DeployInhibited(cmGeneratorTarget const& target, + const char* config) const; + + /** Returns true if the target system support debugging deployment. */ + virtual bool TargetSystemSupportsDeployment() const; static cmIDEFlagTable const* GetExtraFlagTableVS8(); void WriteSolutionConfigurations( |