mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-25 09:58:37 -05:00
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
This commit is contained in:
@@ -36,6 +36,31 @@ std::unique_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
|
||||
return this->Parse(std::string(input ? input : ""));
|
||||
}
|
||||
|
||||
std::string cmGeneratorExpression::Evaluate(
|
||||
std::string input, cmLocalGenerator* lg, const std::string& config,
|
||||
cmGeneratorTarget const* headTarget,
|
||||
cmGeneratorExpressionDAGChecker* dagChecker,
|
||||
cmGeneratorTarget const* currentTarget, std::string const& language)
|
||||
{
|
||||
if (Find(input) != std::string::npos) {
|
||||
cmCompiledGeneratorExpression cge(cmListFileBacktrace(), std::move(input));
|
||||
return cge.Evaluate(lg, config, headTarget, dagChecker, currentTarget,
|
||||
language);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
std::string cmGeneratorExpression::Evaluate(
|
||||
const char* input, cmLocalGenerator* lg, const std::string& config,
|
||||
cmGeneratorTarget const* headTarget,
|
||||
cmGeneratorExpressionDAGChecker* dagChecker,
|
||||
cmGeneratorTarget const* currentTarget, std::string const& language)
|
||||
{
|
||||
return input ? Evaluate(std::string(input), lg, config, headTarget,
|
||||
dagChecker, currentTarget, language)
|
||||
: "";
|
||||
}
|
||||
|
||||
const std::string& cmCompiledGeneratorExpression::Evaluate(
|
||||
cmLocalGenerator* lg, const std::string& config,
|
||||
const cmGeneratorTarget* headTarget,
|
||||
|
||||
@@ -45,6 +45,19 @@ public:
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> Parse(
|
||||
const char* input) const;
|
||||
|
||||
static std::string Evaluate(
|
||||
std::string input, cmLocalGenerator* lg, const std::string& config,
|
||||
cmGeneratorTarget const* headTarget = nullptr,
|
||||
cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
|
||||
cmGeneratorTarget const* currentTarget = nullptr,
|
||||
std::string const& language = std::string());
|
||||
static std::string Evaluate(
|
||||
const char* input, cmLocalGenerator* lg, const std::string& config,
|
||||
cmGeneratorTarget const* headTarget = nullptr,
|
||||
cmGeneratorExpressionDAGChecker* dagChecker = nullptr,
|
||||
cmGeneratorTarget const* currentTarget = nullptr,
|
||||
std::string const& language = std::string());
|
||||
|
||||
enum PreprocessContext
|
||||
{
|
||||
StripAllGeneratorExpressions,
|
||||
|
||||
@@ -487,9 +487,8 @@ std::string cmGeneratorTarget::GetOutputName(
|
||||
}
|
||||
|
||||
// Now evaluate genex and update the previously-prepared map entry.
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
|
||||
i->second = cge->Evaluate(this->LocalGenerator, config);
|
||||
i->second =
|
||||
cmGeneratorExpression::Evaluate(outName, this->LocalGenerator, config);
|
||||
} else if (i->second.empty()) {
|
||||
// An empty map entry indicates we have been called recursively
|
||||
// from the above block.
|
||||
@@ -709,9 +708,8 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
|
||||
{
|
||||
if (const char* dirs =
|
||||
depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")) {
|
||||
cmGeneratorExpression ge;
|
||||
cmExpandList(ge.Parse(dirs)->Evaluate(lg, config, headTarget, dagChecker,
|
||||
depTgt, language),
|
||||
cmExpandList(cmGeneratorExpression::Evaluate(dirs, lg, config, headTarget,
|
||||
dagChecker, depTgt, language),
|
||||
result);
|
||||
}
|
||||
if (!depTgt->IsImported() || excludeImported) {
|
||||
@@ -720,9 +718,8 @@ void handleSystemIncludesDep(cmLocalGenerator* lg,
|
||||
|
||||
if (const char* dirs =
|
||||
depTgt->GetProperty("INTERFACE_INCLUDE_DIRECTORIES")) {
|
||||
cmGeneratorExpression ge;
|
||||
cmExpandList(ge.Parse(dirs)->Evaluate(lg, config, headTarget, dagChecker,
|
||||
depTgt, language),
|
||||
cmExpandList(cmGeneratorExpression::Evaluate(dirs, lg, config, headTarget,
|
||||
dagChecker, depTgt, language),
|
||||
result);
|
||||
}
|
||||
}
|
||||
@@ -1092,9 +1089,9 @@ bool cmGeneratorTarget::IsSystemIncludeDirectory(
|
||||
|
||||
std::vector<std::string> result;
|
||||
for (std::string const& it : this->Target->GetSystemIncludeDirectories()) {
|
||||
cmGeneratorExpression ge;
|
||||
cmExpandList(ge.Parse(it)->Evaluate(this->LocalGenerator, config, this,
|
||||
&dagChecker, nullptr, language),
|
||||
cmExpandList(cmGeneratorExpression::Evaluate(it, this->LocalGenerator,
|
||||
config, this, &dagChecker,
|
||||
nullptr, language),
|
||||
result);
|
||||
}
|
||||
|
||||
@@ -2515,13 +2512,12 @@ void cmGeneratorTarget::GetAutoUicOptions(std::vector<std::string>& result,
|
||||
if (!prop) {
|
||||
return;
|
||||
}
|
||||
cmGeneratorExpression ge;
|
||||
|
||||
cmGeneratorExpressionDAGChecker dagChecker(this, "AUTOUIC_OPTIONS", nullptr,
|
||||
nullptr);
|
||||
cmExpandList(
|
||||
ge.Parse(prop)->Evaluate(this->LocalGenerator, config, this, &dagChecker),
|
||||
result);
|
||||
cmExpandList(cmGeneratorExpression::Evaluate(prop, this->LocalGenerator,
|
||||
config, this, &dagChecker),
|
||||
result);
|
||||
}
|
||||
|
||||
void processILibs(const std::string& config,
|
||||
@@ -5552,18 +5548,15 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
|
||||
// Select an output directory.
|
||||
if (const char* config_outdir = this->GetProperty(configProp)) {
|
||||
// Use the user-specified per-configuration output directory.
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge =
|
||||
ge.Parse(config_outdir);
|
||||
out = cge->Evaluate(this->LocalGenerator, config);
|
||||
out = cmGeneratorExpression::Evaluate(config_outdir, this->LocalGenerator,
|
||||
config);
|
||||
|
||||
// Skip per-configuration subdirectory.
|
||||
conf.clear();
|
||||
} else if (const char* outdir = this->GetProperty(propertyName)) {
|
||||
// Use the user-specified output directory.
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outdir);
|
||||
out = cge->Evaluate(this->LocalGenerator, config);
|
||||
out =
|
||||
cmGeneratorExpression::Evaluate(outdir, this->LocalGenerator, config);
|
||||
|
||||
// Skip per-configuration subdirectory if the value contained a
|
||||
// generator expression.
|
||||
@@ -5631,18 +5624,15 @@ bool cmGeneratorTarget::ComputePDBOutputDir(const std::string& kind,
|
||||
// Select an output directory.
|
||||
if (const char* config_outdir = this->GetProperty(configProp)) {
|
||||
// Use the user-specified per-configuration output directory.
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge =
|
||||
ge.Parse(config_outdir);
|
||||
out = cge->Evaluate(this->LocalGenerator, config);
|
||||
out = cmGeneratorExpression::Evaluate(config_outdir, this->LocalGenerator,
|
||||
config);
|
||||
|
||||
// Skip per-configuration subdirectory.
|
||||
conf.clear();
|
||||
} else if (const char* outdir = this->GetProperty(propertyName)) {
|
||||
// Use the user-specified output directory.
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outdir);
|
||||
out = cge->Evaluate(this->LocalGenerator, config);
|
||||
out =
|
||||
cmGeneratorExpression::Evaluate(outdir, this->LocalGenerator, config);
|
||||
|
||||
// Skip per-configuration subdirectory if the value contained a
|
||||
// generator expression.
|
||||
@@ -5697,8 +5687,7 @@ bool cmGeneratorTarget::GetRPATH(const std::string& config,
|
||||
return false;
|
||||
}
|
||||
|
||||
cmGeneratorExpression ge;
|
||||
rpath = ge.Parse(value)->Evaluate(this->LocalGenerator, config);
|
||||
rpath = cmGeneratorExpression::Evaluate(value, this->LocalGenerator, config);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -663,10 +663,8 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
|
||||
for (std::string const& i : configs) {
|
||||
const char* propertyValue =
|
||||
target->Target->GetMakefile()->GetDefinition(propertyName);
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge =
|
||||
ge.Parse(propertyValue);
|
||||
if (cmIsOn(cge->Evaluate(target->GetLocalGenerator(), i))) {
|
||||
if (cmIsOn(cmGeneratorExpression::Evaluate(
|
||||
propertyValue, target->GetLocalGenerator(), i))) {
|
||||
activeConfigs.insert(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,11 +284,9 @@ 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 = cmIsOn(prop);
|
||||
if (const char* prop = target.GetProperty("VS_NO_SOLUTION_DEPLOY")) {
|
||||
rVal = cmIsOn(
|
||||
cmGeneratorExpression::Evaluate(prop, target.LocalGenerator, config));
|
||||
}
|
||||
return rVal;
|
||||
}
|
||||
|
||||
@@ -2381,10 +2381,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
||||
std::string attribute = prop.substr(16);
|
||||
this->FilterConfigurationAttribute(configName, attribute);
|
||||
if (!attribute.empty()) {
|
||||
cmGeneratorExpression ge;
|
||||
std::string processed =
|
||||
ge.Parse(gtgt->GetProperty(prop))
|
||||
->Evaluate(this->CurrentLocalGenerator, configName);
|
||||
std::string processed = cmGeneratorExpression::Evaluate(
|
||||
gtgt->GetProperty(prop), this->CurrentLocalGenerator, configName);
|
||||
buildSettings->AddAttribute(attribute,
|
||||
this->CreateString(processed));
|
||||
}
|
||||
@@ -3118,10 +3116,9 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
|
||||
std::string attribute = var.substr(22);
|
||||
this->FilterConfigurationAttribute(config.first, attribute);
|
||||
if (!attribute.empty()) {
|
||||
cmGeneratorExpression ge;
|
||||
std::string processed =
|
||||
ge.Parse(this->CurrentMakefile->GetDefinition(var))
|
||||
->Evaluate(this->CurrentLocalGenerator, config.first);
|
||||
std::string processed = cmGeneratorExpression::Evaluate(
|
||||
this->CurrentMakefile->GetDefinition(var),
|
||||
this->CurrentLocalGenerator, config.first);
|
||||
buildSettingsForCfg->AddAttribute(attribute,
|
||||
this->CreateString(processed));
|
||||
}
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include "cmStringAlgorithms.h"
|
||||
#include "cmSystemTools.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
|
||||
std::vector<std::string> const& dirs, const char* dest,
|
||||
const char* file_permissions, const char* dir_permissions,
|
||||
@@ -64,10 +62,9 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig(
|
||||
std::ostream& os, const std::string& config, Indent indent)
|
||||
{
|
||||
std::vector<std::string> dirs;
|
||||
cmGeneratorExpression ge;
|
||||
for (std::string const& d : this->Directories) {
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(d);
|
||||
cmExpandList(cge->Evaluate(this->LocalGenerator, config), dirs);
|
||||
cmExpandList(
|
||||
cmGeneratorExpression::Evaluate(d, this->LocalGenerator, config), dirs);
|
||||
}
|
||||
|
||||
// Make sure all dirs have absolute paths.
|
||||
@@ -97,6 +94,6 @@ void cmInstallDirectoryGenerator::AddDirectoryInstallRule(
|
||||
std::string cmInstallDirectoryGenerator::GetDestination(
|
||||
std::string const& config) const
|
||||
{
|
||||
cmGeneratorExpression ge;
|
||||
return ge.Parse(this->Destination)->Evaluate(this->LocalGenerator, config);
|
||||
return cmGeneratorExpression::Evaluate(this->Destination,
|
||||
this->LocalGenerator, config);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
#include "cmInstallType.h"
|
||||
#include "cmStringAlgorithms.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
class cmLocalGenerator;
|
||||
|
||||
cmInstallFilesGenerator::cmInstallFilesGenerator(
|
||||
@@ -51,8 +49,8 @@ bool cmInstallFilesGenerator::Compute(cmLocalGenerator* lg)
|
||||
std::string cmInstallFilesGenerator::GetDestination(
|
||||
std::string const& config) const
|
||||
{
|
||||
cmGeneratorExpression ge;
|
||||
return ge.Parse(this->Destination)->Evaluate(this->LocalGenerator, config);
|
||||
return cmGeneratorExpression::Evaluate(this->Destination,
|
||||
this->LocalGenerator, config);
|
||||
}
|
||||
|
||||
void cmInstallFilesGenerator::AddFilesInstallRule(
|
||||
@@ -82,10 +80,9 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(
|
||||
std::ostream& os, const std::string& config, Indent indent)
|
||||
{
|
||||
std::vector<std::string> files;
|
||||
cmGeneratorExpression ge;
|
||||
for (std::string const& f : this->Files) {
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(f);
|
||||
cmExpandList(cge->Evaluate(this->LocalGenerator, config), files);
|
||||
cmExpandList(
|
||||
cmGeneratorExpression::Evaluate(f, this->LocalGenerator, config), files);
|
||||
}
|
||||
this->AddFilesInstallRule(os, config, indent, files);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmInstallScriptGenerator.h"
|
||||
|
||||
#include <memory>
|
||||
#include <ostream>
|
||||
#include <vector>
|
||||
|
||||
@@ -79,11 +78,9 @@ void cmInstallScriptGenerator::GenerateScriptForConfig(
|
||||
std::ostream& os, const std::string& config, Indent indent)
|
||||
{
|
||||
if (this->AllowGenex) {
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge =
|
||||
ge.Parse(this->Script);
|
||||
this->AddScriptInstallRule(os, indent,
|
||||
cge->Evaluate(this->LocalGenerator, config));
|
||||
cmGeneratorExpression::Evaluate(
|
||||
this->Script, this->LocalGenerator, config));
|
||||
} else {
|
||||
this->AddScriptInstallRule(os, indent, this->Script);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
#include <cassert>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
@@ -375,9 +374,8 @@ void cmInstallTargetGenerator::GetInstallObjectNames(
|
||||
std::string cmInstallTargetGenerator::GetDestination(
|
||||
std::string const& config) const
|
||||
{
|
||||
cmGeneratorExpression ge;
|
||||
return ge.Parse(this->Destination)
|
||||
->Evaluate(this->Target->GetLocalGenerator(), config);
|
||||
return cmGeneratorExpression::Evaluate(
|
||||
this->Destination, this->Target->GetLocalGenerator(), config);
|
||||
}
|
||||
|
||||
std::string cmInstallTargetGenerator::GetInstallFilename(
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <functional>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
@@ -357,10 +356,8 @@ static Json::Value DumpCTestInfo(cmLocalGenerator* lg, cmTest* testInfo,
|
||||
}
|
||||
|
||||
// Remove any config specific variables from the output.
|
||||
cmGeneratorExpression ge;
|
||||
auto cge = ge.Parse(command);
|
||||
const std::string& processed = cge->Evaluate(lg, config);
|
||||
result[kCTEST_COMMAND] = processed;
|
||||
result[kCTEST_COMMAND] =
|
||||
cmGeneratorExpression::Evaluate(command, lg, config);
|
||||
|
||||
// Build up the list of properties that may have been specified
|
||||
Json::Value properties = Json::arrayValue;
|
||||
@@ -369,9 +366,8 @@ static Json::Value DumpCTestInfo(cmLocalGenerator* lg, cmTest* testInfo,
|
||||
entry[kKEY_KEY] = prop.first;
|
||||
|
||||
// Remove config variables from the value too.
|
||||
auto cge_value = ge.Parse(prop.second);
|
||||
const std::string& processed_value = cge_value->Evaluate(lg, config);
|
||||
entry[kVALUE_KEY] = processed_value;
|
||||
entry[kVALUE_KEY] =
|
||||
cmGeneratorExpression::Evaluate(prop.second, lg, config);
|
||||
properties.append(entry);
|
||||
}
|
||||
result[kPROPERTIES_KEY] = properties;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -608,12 +608,10 @@ void cmLocalNinjaGenerator::AdditionalCleanFiles()
|
||||
this->Makefile->GetProperty("ADDITIONAL_CLEAN_FILES")) {
|
||||
std::vector<std::string> cleanFiles;
|
||||
{
|
||||
cmGeneratorExpression ge;
|
||||
auto cge = ge.Parse(prop_value);
|
||||
cmExpandList(
|
||||
cge->Evaluate(this,
|
||||
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")),
|
||||
cleanFiles);
|
||||
cmExpandList(cmGeneratorExpression::Evaluate(
|
||||
prop_value, this,
|
||||
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")),
|
||||
cleanFiles);
|
||||
}
|
||||
std::string const& binaryDir = this->GetCurrentBinaryDirectory();
|
||||
cmGlobalNinjaGenerator* gg = this->GetGlobalNinjaGenerator();
|
||||
|
||||
@@ -1083,12 +1083,10 @@ void cmLocalUnixMakefileGenerator3::AppendDirectoryCleanCommand(
|
||||
// Look for additional files registered for cleaning in this directory.
|
||||
if (const char* prop_value =
|
||||
this->Makefile->GetProperty("ADDITIONAL_CLEAN_FILES")) {
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop_value);
|
||||
cmExpandList(
|
||||
cge->Evaluate(this,
|
||||
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")),
|
||||
cleanFiles);
|
||||
cmExpandList(cmGeneratorExpression::Evaluate(
|
||||
prop_value, this,
|
||||
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")),
|
||||
cleanFiles);
|
||||
}
|
||||
if (cleanFiles.empty()) {
|
||||
return;
|
||||
|
||||
@@ -154,11 +154,10 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
|
||||
auto evaluatedFiles =
|
||||
[this](const char* prop_value) -> std::vector<std::string> {
|
||||
std::vector<std::string> files;
|
||||
cmGeneratorExpression ge;
|
||||
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop_value);
|
||||
cmExpandList(cge->Evaluate(this->LocalGenerator, this->ConfigName,
|
||||
this->GeneratorTarget, nullptr, nullptr),
|
||||
files);
|
||||
cmExpandList(
|
||||
cmGeneratorExpression::Evaluate(prop_value, this->LocalGenerator,
|
||||
this->ConfigName, this->GeneratorTarget),
|
||||
files);
|
||||
return files;
|
||||
};
|
||||
|
||||
|
||||
@@ -1317,14 +1317,11 @@ void cmNinjaTargetGenerator::AdditionalCleanFiles()
|
||||
this->GeneratorTarget->GetProperty("ADDITIONAL_CLEAN_FILES")) {
|
||||
cmLocalNinjaGenerator* lg = this->LocalGenerator;
|
||||
std::vector<std::string> cleanFiles;
|
||||
{
|
||||
cmGeneratorExpression ge;
|
||||
auto cge = ge.Parse(prop_value);
|
||||
cmExpandList(cge->Evaluate(
|
||||
lg, this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"),
|
||||
this->GeneratorTarget, nullptr, nullptr),
|
||||
cleanFiles);
|
||||
}
|
||||
cmExpandList(cmGeneratorExpression::Evaluate(
|
||||
prop_value, lg,
|
||||
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"),
|
||||
this->GeneratorTarget),
|
||||
cleanFiles);
|
||||
std::string const& binaryDir = lg->GetCurrentBinaryDirectory();
|
||||
cmGlobalNinjaGenerator* gg = lg->GetGlobalNinjaGenerator();
|
||||
for (std::string const& cleanFile : cleanFiles) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user