summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-17 17:26:27 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-10-17 17:26:33 (GMT)
commitf21d811c7c4c9b61c6c81414b3e8803db392183c (patch)
tree2ae1ebd3c0c27ddb1ad8af408d20dfd2734ebf08 /Source
parentcd4ed3ecb2ecfe3e2043ae0338a02323a508e0dd (diff)
parentb8bb6ba653df9d53d93824bb7185bf022e9bf2ef (diff)
downloadCMake-f21d811c7c4c9b61c6c81414b3e8803db392183c.zip
CMake-f21d811c7c4c9b61c6c81414b3e8803db392183c.tar.gz
CMake-f21d811c7c4c9b61c6c81414b3e8803db392183c.tar.bz2
Merge topic 'gem-string'
b8bb6ba653 cmGeneratorTarget::GetExportMacro: return const std::string* Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2485
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx4
-rw-r--r--Source/cmGeneratorTarget.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx4
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx10
6 files changed, 15 insertions, 13 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 80fb621..ea283c6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1730,7 +1730,7 @@ bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
this->GetType() == cmStateEnums::EXECUTABLE;
}
-const char* cmGeneratorTarget::GetExportMacro() const
+const std::string* cmGeneratorTarget::GetExportMacro() const
{
// Define the symbol for targets that export symbols.
if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
@@ -1743,7 +1743,7 @@ const char* cmGeneratorTarget::GetExportMacro() const
in += "_EXPORTS";
this->ExportMacro = cmSystemTools::MakeCidentifier(in);
}
- return this->ExportMacro.c_str();
+ return &this->ExportMacro;
}
return nullptr;
}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index b1daa53..98669c3 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -283,7 +283,7 @@ public:
/** Get the macro to define when building sources in this target.
If no macro should be defined null is returned. */
- const char* GetExportMacro() const;
+ const std::string* GetExportMacro() const;
/** Get the soname of the target. Allowed only for a shared library. */
std::string GetSOName(const std::string& config) const;
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e353a37..596bc6b 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1814,9 +1814,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
BuildObjectListOrString ppDefs(this, true);
this->AppendDefines(
ppDefs, "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"");
- if (const char* exportMacro = gtgt->GetExportMacro()) {
+ if (const std::string* exportMacro = gtgt->GetExportMacro()) {
// Add the export symbol definition for shared library objects.
- this->AppendDefines(ppDefs, exportMacro);
+ this->AppendDefines(ppDefs, exportMacro->c_str());
}
std::vector<std::string> targetDefines;
if (!langForPreprocessor.empty()) {
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 229f884..941d787 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1253,8 +1253,8 @@ void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target,
std::set<std::string>& defines) const
{
// Add the export symbol definition for shared library objects.
- if (const char* exportMacro = target->GetExportMacro()) {
- this->AppendDefines(defines, exportMacro);
+ if (const std::string* exportMacro = target->GetExportMacro()) {
+ this->AppendDefines(defines, *exportMacro);
}
// Add preprocessor definitions for this target and configuration.
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 8428672..1da077e 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -735,8 +735,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
targetOptions.AddDefine(configDefine);
// Add the export symbol definition for shared library objects.
- if (const char* exportMacro = target->GetExportMacro()) {
- targetOptions.AddDefine(exportMacro);
+ if (const std::string* exportMacro = target->GetExportMacro()) {
+ targetOptions.AddDefine(*exportMacro);
}
// The intermediate directory name consists of a directory for the
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 9b96f56..7383efd 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -2566,8 +2566,9 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
configDefine += configName;
configDefine += "\"";
clOptions.AddDefine(configDefine);
- if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) {
- clOptions.AddDefine(exportMacro);
+ if (const std::string* exportMacro =
+ this->GeneratorTarget->GetExportMacro()) {
+ clOptions.AddDefine(*exportMacro);
}
if (this->MSTools) {
@@ -2863,8 +2864,9 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
configDefine += configName;
configDefine += "\"";
cudaOptions.AddDefine(configDefine);
- if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) {
- cudaOptions.AddDefine(exportMacro);
+ if (const std::string* exportMacro =
+ this->GeneratorTarget->GetExportMacro()) {
+ cudaOptions.AddDefine(*exportMacro);
}
// Get includes for this target