summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmGeneratorTarget.cxx6
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmQtAutoGenInitializer.cxx11
3 files changed, 6 insertions, 13 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3989ebe822..098c13a48f 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -3358,14 +3358,12 @@ std::string cmGeneratorTarget::GetFullNameInternal(
return prefix + base + suffix;
}
-const char* cmGeneratorTarget::ImportedGetLocation(
+std::string cmGeneratorTarget::ImportedGetLocation(
const std::string& config) const
{
- static std::string location;
assert(this->IsImported());
- location = this->Target->ImportedGetFullPath(
+ return this->Target->ImportedGetFullPath(
config, cmStateEnums::RuntimeBinaryArtifact);
- return location.c_str();
}
std::string cmGeneratorTarget::GetFullNameImported(
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 6a361162d6..6c1f9315c4 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -658,7 +658,7 @@ public:
no soname at all. */
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
the VERSION property. Version 0 is returned if the property is
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index a0fd1b1a93..fd9829fb07 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -37,11 +37,6 @@
#include <utility>
#include <vector>
-inline static const char* SafeString(const char* value)
-{
- return (value != nullptr) ? value : "";
-}
-
static std::size_t GetParallelCPUCount()
{
static std::size_t count = 0;
@@ -1268,7 +1263,7 @@ bool cmQtAutoGenInitializer::GetMocExecutable()
cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) {
- this->Moc.Executable = SafeString(tgt->ImportedGetLocation(""));
+ this->Moc.Executable = tgt->ImportedGetLocation("");
} else {
err = "Could not find target " + targetName;
}
@@ -1329,7 +1324,7 @@ bool cmQtAutoGenInitializer::GetUicExecutable()
cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) {
- this->Uic.Executable = SafeString(tgt->ImportedGetLocation(""));
+ this->Uic.Executable = tgt->ImportedGetLocation("");
} else {
if (this->QtVersionMajor == "5") {
// Project does not use Qt5Widgets, but has AUTOUIC ON anyway
@@ -1394,7 +1389,7 @@ bool cmQtAutoGenInitializer::GetRccExecutable()
cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) {
- this->Rcc.Executable = SafeString(tgt->ImportedGetLocation(""));
+ this->Rcc.Executable = tgt->ImportedGetLocation("");
} else {
err = "Could not find target " + targetName;
}