summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2023-05-26 09:09:07 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2023-05-26 12:48:22 (GMT)
commitaa5fed5052f903614a06c55786a1f682fee787a5 (patch)
treeadcf76aa35a0f8aab8b0a15db3be43cfd773855c /Source/cmTarget.cxx
parenta645a80040d35162ba34ddec39b1b90b2466b72f (diff)
downloadCMake-aa5fed5052f903614a06c55786a1f682fee787a5.zip
CMake-aa5fed5052f903614a06c55786a1f682fee787a5.tar.gz
CMake-aa5fed5052f903614a06c55786a1f682fee787a5.tar.bz2
SetProperty: suppress raw pointer usage
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx32
1 files changed, 2 insertions, 30 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0fbe430..b55554d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1810,26 +1810,7 @@ MAKE_PROP(INTERFACE_LINK_LIBRARIES_DIRECT_EXCLUDE);
#undef MAKE_PROP
}
-namespace {
-// to workaround bug on GCC/AIX
-// Define a template to force conversion to std::string
-template <typename ValueType>
-std::string ConvertToString(ValueType value);
-
-template <>
-std::string ConvertToString<const char*>(const char* value)
-{
- return std::string(value);
-}
-template <>
-std::string ConvertToString<cmValue>(cmValue value)
-{
- return std::string(*value);
-}
-}
-
-template <typename ValueType>
-void cmTarget::StoreProperty(const std::string& prop, ValueType value)
+void cmTarget::SetProperty(const std::string& prop, cmValue value)
{
if (prop == propMANUALLY_ADDED_DEPENDENCIES) {
this->impl->Makefile->IssueMessage(
@@ -1975,7 +1956,7 @@ void cmTarget::StoreProperty(const std::string& prop, ValueType value)
std::string reusedFrom = reusedTarget->GetSafeProperty(prop);
if (reusedFrom.empty()) {
- reusedFrom = ConvertToString(value);
+ reusedFrom = *value;
}
this->impl->Properties.SetProperty(prop, reusedFrom);
@@ -2091,15 +2072,6 @@ void cmTarget::AppendProperty(const std::string& prop,
}
}
-void cmTarget::SetProperty(const std::string& prop, const char* value)
-{
- this->StoreProperty(prop, value);
-}
-void cmTarget::SetProperty(const std::string& prop, cmValue value)
-{
- this->StoreProperty(prop, value);
-}
-
template <typename ValueType>
void cmTargetInternals::AddDirectoryToFileSet(cmTarget* self,
std::string const& fileSetName,