diff options
author | Brad King <brad.king@kitware.com> | 2020-03-17 12:05:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-17 12:06:18 (GMT) |
commit | 97562a202325093a88910c6cd2615a0ef77ce715 (patch) | |
tree | d98fc98973090497726371009a3a64b1f60d2e43 /Source/cmTarget.cxx | |
parent | d2e0b8bcfdf93806a01917e3692cc93a34d2f90c (diff) | |
parent | fad0ee54041bf05f0d22b78e111b03eb368a213c (diff) | |
download | CMake-97562a202325093a88910c6cd2615a0ef77ce715.zip CMake-97562a202325093a88910c6cd2615a0ef77ce715.tar.gz CMake-97562a202325093a88910c6cd2615a0ef77ce715.tar.bz2 |
Merge topic 'property-computer'
fad0ee5404 cmTargetPropertyComputer::GetProperty: return cmProp
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4482
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 0b01cda..f92eea4 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -78,7 +78,7 @@ const std::string& cmTargetPropertyComputer::ComputeLocation<cmTarget>( } template <> -const char* cmTargetPropertyComputer::GetSources<cmTarget>( +cmProp cmTargetPropertyComputer::GetSources<cmTarget>( cmTarget const* tgt, cmMessenger* messenger, cmListFileBacktrace const& context) { @@ -156,7 +156,7 @@ const char* cmTargetPropertyComputer::GetSources<cmTarget>( } static std::string srcs; srcs = ss.str(); - return srcs.c_str(); + return &srcs; } class cmTargetInternals @@ -1613,7 +1613,9 @@ const char* cmTarget::GetComputedProperty( const std::string& prop, cmMessenger* messenger, cmListFileBacktrace const& context) const { - return cmTargetPropertyComputer::GetProperty(this, prop, messenger, context); + cmProp retVal = + cmTargetPropertyComputer::GetProperty(this, prop, messenger, context); + return retVal ? retVal->c_str() : nullptr; } const char* cmTarget::GetProperty(const std::string& prop) const |