diff options
author | biao716.wang <biao716.wang@samsung.com> | 2020-03-19 01:04:30 +0900 |
---|---|---|
committer | biao716.wang <biao716.wang@samsung.com> | 2020-03-19 01:04:30 +0900 |
commit | 1d6613f4446f69f63beddf2d97c201154fb35e33 (patch) | |
tree | f32eae75900a0df14ab8fa1e2bd436af159ef91d /Source/cmIncludeExternalMSProjectCommand.cxx | |
parent | aabcd8e66e3268a232efe2e416635d5b6bf84ad5 (diff) | |
download | cmake-upstream/3.16.4.tar.gz cmake-upstream/3.16.4.tar.bz2 cmake-upstream/3.16.4.zip |
Imported Upstream version 3.16.4upstream/3.16.4
Change-Id: Ic5262ea6c0872b353ea2dc35fe1e944063ae8409
Signed-off-by: biao716.wang <biao716.wang@samsung.com>
Diffstat (limited to 'Source/cmIncludeExternalMSProjectCommand.cxx')
-rw-r--r-- | Source/cmIncludeExternalMSProjectCommand.cxx | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx index 03388c7e9..fa1e8bcf9 100644 --- a/Source/cmIncludeExternalMSProjectCommand.cxx +++ b/Source/cmIncludeExternalMSProjectCommand.cxx @@ -2,27 +2,31 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmIncludeExternalMSProjectCommand.h" +#include "cmExecutionStatus.h" + #ifdef _WIN32 -#include "cmMakefile.h" -#include "cmStateTypes.h" -#include "cmSystemTools.h" -#include "cmTarget.h" +# include "cmGlobalGenerator.h" +# include "cmMakefile.h" +# include "cmStateTypes.h" +# include "cmSystemTools.h" +# include "cmTarget.h" +# include "cmake.h" #endif -class cmExecutionStatus; - -// cmIncludeExternalMSProjectCommand -bool cmIncludeExternalMSProjectCommand::InitialPass( - std::vector<std::string> const& args, cmExecutionStatus&) +bool cmIncludeExternalMSProjectCommand(std::vector<std::string> const& args, + cmExecutionStatus& status) { if (args.size() < 2) { - this->SetError("INCLUDE_EXTERNAL_MSPROJECT called with incorrect " - "number of arguments"); + status.SetError("INCLUDE_EXTERNAL_MSPROJECT called with incorrect " + "number of arguments"); return false; } + // only compile this for win32 to avoid coverage errors #ifdef _WIN32 - if (this->Makefile->GetDefinition("WIN32")) { + cmMakefile& mf = status.GetMakefile(); + if (mf.GetDefinition("WIN32") || + mf.GetGlobalGenerator()->IsIncludeExternalMSProjectSupported()) { enum Doing { DoingNone, @@ -73,27 +77,28 @@ bool cmIncludeExternalMSProjectCommand::InitialPass( if (!customGuid.empty()) { std::string guidVariable = utility_name + "_GUID_CMAKE"; - this->Makefile->GetCMakeInstance()->AddCacheEntry( - guidVariable.c_str(), customGuid.c_str(), "Stored GUID", - cmStateEnums::INTERNAL); + mf.GetCMakeInstance()->AddCacheEntry(guidVariable.c_str(), + customGuid.c_str(), "Stored GUID", + cmStateEnums::INTERNAL); } // Create a target instance for this utility. - cmTarget* target = this->Makefile->AddNewTarget(cmStateEnums::UTILITY, - utility_name.c_str()); + cmTarget* target = + mf.AddNewTarget(cmStateEnums::UTILITY, utility_name.c_str()); + if (mf.GetPropertyAsBool("EXCLUDE_FROM_ALL")) { + target->SetProperty("EXCLUDE_FROM_ALL", "TRUE"); + } target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str()); target->SetProperty("EXTERNAL_MSPROJECT", path.c_str()); - target->SetProperty("EXCLUDE_FROM_ALL", "FALSE"); if (!customType.empty()) target->SetProperty("VS_PROJECT_TYPE", customType.c_str()); if (!platformMapping.empty()) target->SetProperty("VS_PLATFORM_MAPPING", platformMapping.c_str()); - for (std::vector<std::string>::const_iterator it = depends.begin(); - it != depends.end(); ++it) { - target->AddUtility(it->c_str()); + for (std::string const& d : depends) { + target->AddUtility(d.c_str()); } } #endif |