summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-14 11:19:25 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-07-14 11:20:15 (GMT)
commit35928fa7ca4c2b4cc39c4cf6aaa2059ebb3b86ce (patch)
tree34d49dde5bc444c7d3e9f999ba91328dfb660ba0 /Source/cmGeneratorTarget.cxx
parent2455ec9565a570557ba1cf1417d27e6bdcb65614 (diff)
parent18726ad634d0f182940d45e9f569000cebcc4377 (diff)
downloadCMake-35928fa7ca4c2b4cc39c4cf6aaa2059ebb3b86ce.zip
CMake-35928fa7ca4c2b4cc39c4cf6aaa2059ebb3b86ce.tar.gz
CMake-35928fa7ca4c2b4cc39c4cf6aaa2059ebb3b86ce.tar.bz2
Merge topic 'getfeature-prop'
18726ad634 GetFeature(): return cmProp Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5004
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index b202e91..9e6f995 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -815,18 +815,18 @@ void cmGeneratorTarget::ComputeObjectMapping()
}
}
-const char* cmGeneratorTarget::GetFeature(const std::string& feature,
- const std::string& config) const
+cmProp cmGeneratorTarget::GetFeature(const std::string& feature,
+ const std::string& config) const
{
if (!config.empty()) {
std::string featureConfig =
cmStrCat(feature, '_', cmSystemTools::UpperCase(config));
if (cmProp value = this->GetProperty(featureConfig)) {
- return value->c_str();
+ return value;
}
}
if (cmProp value = this->GetProperty(feature)) {
- return value->c_str();
+ return value;
}
return this->LocalGenerator->GetFeature(feature, config);
}
@@ -853,8 +853,8 @@ const char* cmGeneratorTarget::GetLinkPIEProperty(
bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
std::string const& config) const
{
- const char* feature = "INTERPROCEDURAL_OPTIMIZATION";
- const bool result = cmIsOn(this->GetFeature(feature, config));
+ cmProp feature = this->GetFeature("INTERPROCEDURAL_OPTIMIZATION", config);
+ const bool result = feature && cmIsOn(*feature);
if (!result) {
// 'INTERPROCEDURAL_OPTIMIZATION' is off, no need to check policies