diff options
author | Brad King <brad.king@kitware.com> | 2019-09-05 14:31:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-09-05 14:31:56 (GMT) |
commit | 5acf0de1feb83a8ec5d8f1348091501919b17cad (patch) | |
tree | 0d95a98e98ed5832159b97cbf8bc2fd521d7d3e1 /Source/cmLocalGenerator.cxx | |
parent | 6db8f6a410d99e9a66847530bb520b329d2f1a9e (diff) | |
download | CMake-5acf0de1feb83a8ec5d8f1348091501919b17cad.zip CMake-5acf0de1feb83a8ec5d8f1348091501919b17cad.tar.gz CMake-5acf0de1feb83a8ec5d8f1348091501919b17cad.tar.bz2 |
cmLocalGenerator: Remove AppendFlags 'const char*' overload
Update call sites to ensure the `std::string` argument can be
constructed safely.
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e2402ad..9152e94 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1125,10 +1125,10 @@ void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags, this->AppendFlags(flags, this->Makefile->GetSafeDefinition(name)); } } - this->AppendFlags(flags, target->GetProperty("STATIC_LIBRARY_FLAGS")); + this->AppendFlags(flags, target->GetSafeProperty("STATIC_LIBRARY_FLAGS")); if (!config.empty()) { std::string name = "STATIC_LIBRARY_FLAGS_" + config; - this->AppendFlags(flags, target->GetProperty(name)); + this->AppendFlags(flags, target->GetSafeProperty(name)); } std::vector<std::string> options; @@ -1744,7 +1744,7 @@ void cmLocalGenerator::AddSharedFlags(std::string& flags, // Add flags for dealing with shared libraries for this language. if (shared) { this->AppendFlags(flags, - this->Makefile->GetDefinition( + this->Makefile->GetSafeDefinition( cmStrCat("CMAKE_SHARED_LIBRARY_", lang, "_FLAGS"))); } } @@ -2090,12 +2090,12 @@ void cmLocalGenerator::AddConfigVariableFlags(std::string& flags, { // Add the flags from the variable itself. std::string flagsVar = var; - this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar)); + this->AppendFlags(flags, this->Makefile->GetSafeDefinition(flagsVar)); // Add the flags from the build-type specific variable. if (!config.empty()) { flagsVar += "_"; flagsVar += cmSystemTools::UpperCase(config); - this->AppendFlags(flags, this->Makefile->GetDefinition(flagsVar)); + this->AppendFlags(flags, this->Makefile->GetSafeDefinition(flagsVar)); } } @@ -2110,14 +2110,6 @@ void cmLocalGenerator::AppendFlags(std::string& flags, } } -void cmLocalGenerator::AppendFlags(std::string& flags, - const char* newFlags) const -{ - if (newFlags && *newFlags) { - this->AppendFlags(flags, std::string(newFlags)); - } -} - void cmLocalGenerator::AppendFlagEscape(std::string& flags, const std::string& rawFlag) const { |