summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-08 17:00:00 -0400
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-03-08 17:22:43 -0400
commitb0dc52704b5c4627c9ac11f1c63236367d7e3d3c (patch)
tree30c678d7762c831c13ca34b5078626cc9255eda4 /Source
parent1bb7474abac4eb3aa7dd1b52d9d09d2205e104f3 (diff)
downloadcmake-b0dc52704b5c4627c9ac11f1c63236367d7e3d3c.tar.gz
cmGeneratorExpression: remove const char* overloads
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorExpression.cxx17
-rw-r--r--Source/cmGeneratorExpression.h8
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx5
-rw-r--r--Source/cmInstalledFile.cxx2
-rw-r--r--Source/cmMakefileTargetGenerator.cxx2
6 files changed, 7 insertions, 30 deletions
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 03c2a0ca23..6e293d51a8 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -32,12 +32,6 @@ std::unique_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
new cmCompiledGeneratorExpression(this->Backtrace, std::move(input)));
}
-std::unique_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
- const char* input) const
-{
- return this->Parse(std::string(input ? input : ""));
-}
-
std::string cmGeneratorExpression::Evaluate(
std::string input, cmLocalGenerator* lg, const std::string& config,
cmGeneratorTarget const* headTarget,
@@ -52,17 +46,6 @@ std::string cmGeneratorExpression::Evaluate(
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,
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index a0e40c3950..75bba02d2e 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -42,8 +42,6 @@ public:
std::unique_ptr<cmCompiledGeneratorExpression> Parse(
std::string input) const;
- std::unique_ptr<cmCompiledGeneratorExpression> Parse(
- const char* input) const;
static std::string Evaluate(
std::string input, cmLocalGenerator* lg, const std::string& config,
@@ -51,12 +49,6 @@ public:
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
{
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 97991240b5..eb3382544c 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -676,7 +676,8 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
for (std::string const& i : configs) {
const char* propertyValue =
target->Target->GetMakefile()->GetDefinition(propertyName);
- if (cmIsOn(cmGeneratorExpression::Evaluate(
+ if (propertyValue &&
+ cmIsOn(cmGeneratorExpression::Evaluate(
propertyValue, target->GetLocalGenerator(), i))) {
activeConfigs.insert(i);
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 9437e9510e..ac7d204a89 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2411,8 +2411,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
std::string attribute = prop.substr(16);
this->FilterConfigurationAttribute(configName, attribute);
if (!attribute.empty()) {
+ const char* pr = gtgt->GetProperty(prop);
std::string processed = cmGeneratorExpression::Evaluate(
- gtgt->GetProperty(prop), this->CurrentLocalGenerator, configName);
+ pr ? pr : "", this->CurrentLocalGenerator, configName);
buildSettings->AddAttribute(attribute,
this->CreateString(processed));
}
@@ -3147,7 +3148,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
this->FilterConfigurationAttribute(config.first, attribute);
if (!attribute.empty()) {
std::string processed = cmGeneratorExpression::Evaluate(
- this->CurrentMakefile->GetDefinition(var),
+ this->CurrentMakefile->GetSafeDefinition(var),
this->CurrentLocalGenerator, config.first);
buildSettingsForCfg->AddAttribute(attribute,
this->CreateString(processed));
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index a65ae037e0..8972a63976 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -56,7 +56,7 @@ void cmInstalledFile::AppendProperty(cmMakefile const* mf,
cmGeneratorExpression ge(backtrace);
Property& property = this->Properties[prop];
- property.ValueExpressions.push_back(ge.Parse(value));
+ property.ValueExpressions.push_back(ge.Parse(value ? value : ""));
}
bool cmInstalledFile::HasProperty(const std::string& prop) const
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index d7e2de6c86..451f19e53a 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -155,7 +155,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
// Evaluates generator expressions and expands prop_value
auto evaluatedFiles =
- [this](const char* prop_value) -> std::vector<std::string> {
+ [this](const std::string& prop_value) -> std::vector<std::string> {
std::vector<std::string> files;
cmExpandList(cmGeneratorExpression::Evaluate(
prop_value, this->LocalGenerator, this->GetConfigName(),