diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-18 09:07:48 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2021-09-19 17:11:07 (GMT) |
commit | 3a1e6f5f59a38ecbaf8f1dcc8872324a73687f02 (patch) | |
tree | c98b106bec9f45b5e9f71201a89968c0cf164f3a /Source/cmGetPropertyCommand.cxx | |
parent | dffa3f485ce5a2336a7fd06c94522e53b0cab37e (diff) | |
download | CMake-3a1e6f5f59a38ecbaf8f1dcc8872324a73687f02.zip CMake-3a1e6f5f59a38ecbaf8f1dcc8872324a73687f02.tar.gz CMake-3a1e6f5f59a38ecbaf8f1dcc8872324a73687f02.tar.bz2 |
remove cmToCStr function
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetPropertyCommand.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index c976dda..5f20075 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -34,10 +34,6 @@ enum OutType OutSet }; -// Implementation of result storage. -bool StoreResult(OutType infoType, cmMakefile& makefile, - const std::string& variable, const char* value); - // Implementation of each property type. bool HandleGlobalMode(cmExecutionStatus& status, const std::string& name, OutType infoType, const std::string& variable, @@ -255,8 +251,10 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args, namespace { +// Implementation of result storage. +template <typename ValueType> bool StoreResult(OutType infoType, cmMakefile& makefile, - const std::string& variable, const char* value) + const std::string& variable, ValueType value) { if (infoType == OutSet) { makefile.AddDefinition(variable, value ? "1" : "0"); @@ -270,10 +268,11 @@ bool StoreResult(OutType infoType, cmMakefile& makefile, } return true; } +template <> bool StoreResult(OutType infoType, cmMakefile& makefile, - const std::string& variable, cmProp value) + const std::string& variable, std::nullptr_t value) { - return StoreResult(infoType, makefile, variable, value.GetCStr()); + return StoreResult(infoType, makefile, variable, cmProp(value)); } bool HandleGlobalMode(cmExecutionStatus& status, const std::string& name, |