Updates will be applied on October 27th between 12pm - 12:45pm EDT (UTC-0400). Gitlab may be slow during the maintenance window.

Commit 86b332c2 authored by Sebastian Holtermann's avatar Sebastian Holtermann
Browse files

Return std::string from cmGeneratorTarget::ImportedGetLocation

parent 189f7235
...@@ -3358,14 +3358,12 @@ std::string cmGeneratorTarget::GetFullNameInternal( ...@@ -3358,14 +3358,12 @@ std::string cmGeneratorTarget::GetFullNameInternal(
return prefix + base + suffix; return prefix + base + suffix;
} }
const char* cmGeneratorTarget::ImportedGetLocation( std::string cmGeneratorTarget::ImportedGetLocation(
const std::string& config) const const std::string& config) const
{ {
static std::string location;
assert(this->IsImported()); assert(this->IsImported());
location = this->Target->ImportedGetFullPath( return this->Target->ImportedGetFullPath(
config, cmStateEnums::RuntimeBinaryArtifact); config, cmStateEnums::RuntimeBinaryArtifact);
return location.c_str();
} }
std::string cmGeneratorTarget::GetFullNameImported( std::string cmGeneratorTarget::GetFullNameImported(
......
...@@ -658,7 +658,7 @@ public: ...@@ -658,7 +658,7 @@ public:
no soname at all. */ no soname at all. */
bool IsImportedSharedLibWithoutSOName(const std::string& config) const; bool IsImportedSharedLibWithoutSOName(const std::string& config) const;
const char* ImportedGetLocation(const std::string& config) const; std::string ImportedGetLocation(const std::string& config) const;
/** Get the target major and minor version numbers interpreted from /** Get the target major and minor version numbers interpreted from
the VERSION property. Version 0 is returned if the property is the VERSION property. Version 0 is returned if the property is
......
...@@ -37,11 +37,6 @@ ...@@ -37,11 +37,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
inline static const char* SafeString(const char* value)
{
return (value != nullptr) ? value : "";
}
static std::size_t GetParallelCPUCount() static std::size_t GetParallelCPUCount()
{ {
static std::size_t count = 0; static std::size_t count = 0;
...@@ -1268,7 +1263,7 @@ bool cmQtAutoGenInitializer::GetMocExecutable() ...@@ -1268,7 +1263,7 @@ bool cmQtAutoGenInitializer::GetMocExecutable()
cmLocalGenerator* localGen = this->Target->GetLocalGenerator(); cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName); cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) { if (tgt != nullptr) {
this->Moc.Executable = SafeString(tgt->ImportedGetLocation("")); this->Moc.Executable = tgt->ImportedGetLocation("");
} else { } else {
err = "Could not find target " + targetName; err = "Could not find target " + targetName;
} }
...@@ -1329,7 +1324,7 @@ bool cmQtAutoGenInitializer::GetUicExecutable() ...@@ -1329,7 +1324,7 @@ bool cmQtAutoGenInitializer::GetUicExecutable()
cmLocalGenerator* localGen = this->Target->GetLocalGenerator(); cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName); cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) { if (tgt != nullptr) {
this->Uic.Executable = SafeString(tgt->ImportedGetLocation("")); this->Uic.Executable = tgt->ImportedGetLocation("");
} else { } else {
if (this->QtVersionMajor == "5") { if (this->QtVersionMajor == "5") {
// Project does not use Qt5Widgets, but has AUTOUIC ON anyway // Project does not use Qt5Widgets, but has AUTOUIC ON anyway
...@@ -1394,7 +1389,7 @@ bool cmQtAutoGenInitializer::GetRccExecutable() ...@@ -1394,7 +1389,7 @@ bool cmQtAutoGenInitializer::GetRccExecutable()
cmLocalGenerator* localGen = this->Target->GetLocalGenerator(); cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName); cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) { if (tgt != nullptr) {
this->Rcc.Executable = SafeString(tgt->ImportedGetLocation("")); this->Rcc.Executable = tgt->ImportedGetLocation("");
} else { } else {
err = "Could not find target " + targetName; err = "Could not find target " + targetName;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment