diff options
author | Daniel Eiband <daniel.eiband@brainlab.com> | 2019-09-22 07:53:44 (GMT) |
---|---|---|
committer | Daniel Eiband <daniel.eiband@brainlab.com> | 2019-09-23 19:19:15 (GMT) |
commit | 7dcf9cb83c2082168f218be8f21b95b77cc95a86 (patch) | |
tree | ee1435acc933654c5d643e3ca5777670407f2cb1 /Source/cmLocalGenerator.cxx | |
parent | c7c59dae82594557dc2fddc4ef881dafeaad076a (diff) | |
download | CMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.zip CMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.tar.gz CMake-7dcf9cb83c2082168f218be8f21b95b77cc95a86.tar.bz2 |
cmGeneratorExpression: Add cmGeneratorExpression::Evaluate utility
cmGeneratorExpression::Evaluate is a shortcut when only the evaluated string is
needed or an instance of cmCompiledGeneratorExpression cannot be cached.
Fixes: #19686
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 19962e3..93e074d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -48,7 +48,6 @@ #include <functional> #include <initializer_list> #include <iterator> -#include <memory> #include <sstream> #include <unordered_set> #include <utility> @@ -925,10 +924,8 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags, // to ON if (char const* jmcExprGen = target->GetProperty("VS_JUST_MY_CODE_DEBUGGING")) { - cmGeneratorExpression ge; - std::unique_ptr<cmCompiledGeneratorExpression> cge = - ge.Parse(jmcExprGen); - std::string isJMCEnabled = cge->Evaluate(this, config); + std::string isJMCEnabled = + cmGeneratorExpression::Evaluate(jmcExprGen, this, config); if (cmIsOn(isJMCEnabled)) { std::vector<std::string> optVec = cmExpandedList(jmc); std::string jmcFlags; @@ -1710,10 +1707,8 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, if (!msvcRuntimeLibraryValue) { msvcRuntimeLibraryValue = msvcRuntimeLibraryDefault; } - cmGeneratorExpression ge; - std::unique_ptr<cmCompiledGeneratorExpression> cge = - ge.Parse(msvcRuntimeLibraryValue); - std::string const msvcRuntimeLibrary = cge->Evaluate(this, config, target); + std::string const msvcRuntimeLibrary = cmGeneratorExpression::Evaluate( + msvcRuntimeLibraryValue, this, config, target); if (!msvcRuntimeLibrary.empty()) { if (const char* msvcRuntimeLibraryOptions = this->Makefile->GetDefinition( |