diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-05-30 12:00:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-05-30 12:59:20 (GMT) |
commit | 7ed8c9ebe33ccafc41ec9e096bf2884d617a0ebf (patch) | |
tree | b17167b762c3257baf362b515fbf1a8fece7b356 /Source/cmMakefile.cxx | |
parent | 6bb20b51c9af40372b6a818826613e965cde5f19 (diff) | |
download | CMake-7ed8c9ebe33ccafc41ec9e096bf2884d617a0ebf.zip CMake-7ed8c9ebe33ccafc41ec9e096bf2884d617a0ebf.tar.gz CMake-7ed8c9ebe33ccafc41ec9e096bf2884d617a0ebf.tar.bz2 |
cmMakefile: add GetDefExpandList() that splits value into std::vector
Combines cmMakefile:GetDefinition() and cmExpandList()
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 154da50..c527a49 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2745,6 +2745,18 @@ const std::string& cmMakefile::GetSafeDefinition(const std::string& name) const return *def; } +bool cmMakefile::GetDefExpandList(const std::string& name, + std::vector<std::string>& out, + bool emptyArgs) const +{ + cmProp def = this->GetDef(name); + if (!def) { + return false; + } + cmExpandList(*def, out, emptyArgs); + return true; +} + std::vector<std::string> cmMakefile::GetDefinitions() const { std::vector<std::string> res = this->StateSnapshot.ClosureKeys(); @@ -3273,10 +3285,7 @@ std::string cmMakefile::GetConfigurations(std::vector<std::string>& configs, bool singleConfig) const { if (this->GetGlobalGenerator()->IsMultiConfig()) { - if (const char* configTypes = - this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) { - cmExpandList(configTypes, configs); - } + this->GetDefExpandList("CMAKE_CONFIGURATION_TYPES", configs); return ""; } const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE"); |