summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorDaniel Eiband <daniel.eiband@brainlab.com>2019-09-22 07:53:44 (GMT)
committerDaniel Eiband <daniel.eiband@brainlab.com>2019-09-23 19:19:15 (GMT)
commit7dcf9cb83c2082168f218be8f21b95b77cc95a86 (patch)
treeee1435acc933654c5d643e3ca5777670407f2cb1 /Source/cmVisualStudio10TargetGenerator.cxx
parentc7c59dae82594557dc2fddc4ef881dafeaad076a (diff)
downloadCMake-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/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx60
1 files changed, 16 insertions, 44 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 4b83595..34aac49 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1139,10 +1139,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
std::string configType;
if (const char* vsConfigurationType =
this->GeneratorTarget->GetProperty("VS_CONFIGURATION_TYPE")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(vsConfigurationType);
- configType = cge->Evaluate(this->LocalGenerator, c);
+ configType = cmGeneratorExpression::Evaluate(vsConfigurationType,
+ this->LocalGenerator, c);
} else {
switch (this->GeneratorTarget->GetType()) {
case cmStateEnums::SHARED_LIBRARY:
@@ -2447,49 +2445,32 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
if (ttype <= cmStateEnums::UTILITY) {
if (const char* workingDir = this->GeneratorTarget->GetProperty(
"VS_DEBUGGER_WORKING_DIRECTORY")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(workingDir);
- std::string genWorkingDir =
- cge->Evaluate(this->LocalGenerator, config);
-
+ std::string genWorkingDir = cmGeneratorExpression::Evaluate(
+ workingDir, this->LocalGenerator, config);
e1.WritePlatformConfigTag("LocalDebuggerWorkingDirectory", cond,
genWorkingDir);
}
if (const char* environment =
this->GeneratorTarget->GetProperty("VS_DEBUGGER_ENVIRONMENT")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(environment);
- std::string genEnvironment =
- cge->Evaluate(this->LocalGenerator, config);
-
+ std::string genEnvironment = cmGeneratorExpression::Evaluate(
+ environment, this->LocalGenerator, config);
e1.WritePlatformConfigTag("LocalDebuggerEnvironment", cond,
genEnvironment);
}
if (const char* debuggerCommand =
this->GeneratorTarget->GetProperty("VS_DEBUGGER_COMMAND")) {
-
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(debuggerCommand);
- std::string genDebuggerCommand =
- cge->Evaluate(this->LocalGenerator, config);
-
+ std::string genDebuggerCommand = cmGeneratorExpression::Evaluate(
+ debuggerCommand, this->LocalGenerator, config);
e1.WritePlatformConfigTag("LocalDebuggerCommand", cond,
genDebuggerCommand);
}
if (const char* commandArguments = this->GeneratorTarget->GetProperty(
"VS_DEBUGGER_COMMAND_ARGUMENTS")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(commandArguments);
- std::string genCommandArguments =
- cge->Evaluate(this->LocalGenerator, config);
-
+ std::string genCommandArguments = cmGeneratorExpression::Evaluate(
+ commandArguments, this->LocalGenerator, config);
e1.WritePlatformConfigTag("LocalDebuggerCommandArguments", cond,
genCommandArguments);
}
@@ -3479,22 +3460,16 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
if (const char* nativeLibDirectoriesExpression =
this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(nativeLibDirectoriesExpression);
- std::string nativeLibDirs =
- cge->Evaluate(this->LocalGenerator, configName);
+ std::string nativeLibDirs = cmGeneratorExpression::Evaluate(
+ nativeLibDirectoriesExpression, this->LocalGenerator, configName);
e2.Element("NativeLibDirectories", nativeLibDirs);
}
if (const char* nativeLibDependenciesExpression =
this->GeneratorTarget->GetProperty(
"ANDROID_NATIVE_LIB_DEPENDENCIES")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(nativeLibDependenciesExpression);
- std::string nativeLibDeps =
- cge->Evaluate(this->LocalGenerator, configName);
+ std::string nativeLibDeps = cmGeneratorExpression::Evaluate(
+ nativeLibDependenciesExpression, this->LocalGenerator, configName);
e2.Element("NativeLibDependencies", nativeLibDeps);
}
@@ -3505,11 +3480,8 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
if (const char* jarDirectoriesExpression =
this->GeneratorTarget->GetProperty("ANDROID_JAR_DIRECTORIES")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(jarDirectoriesExpression);
- std::string jarDirectories =
- cge->Evaluate(this->LocalGenerator, configName);
+ std::string jarDirectories = cmGeneratorExpression::Evaluate(
+ jarDirectoriesExpression, this->LocalGenerator, configName);
e2.Element("JarDirectories", jarDirectories);
}