diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index f375b5f..6b16721 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2200,7 +2200,7 @@ static void AddVisibilityCompileOption(std::string &flags, cmTarget* target, return; } std::string option = std::string(opt) + prop; - lg->AppendFlags(flags, option.c_str()); + lg->AppendFlags(flags, option); } static void AddInlineVisibilityCompileOption(std::string &flags, @@ -2384,11 +2384,10 @@ void cmLocalGenerator::AddConfigVariableFlags(std::string& flags, //---------------------------------------------------------------------------- void cmLocalGenerator::AppendFlags(std::string& flags, - const char* newFlags) + const std::string& newFlags) { - if(newFlags && *newFlags) + if(!newFlags.empty()) { - std::string newf = newFlags; if(flags.size()) { flags += " "; @@ -2398,10 +2397,20 @@ void cmLocalGenerator::AppendFlags(std::string& flags, } //---------------------------------------------------------------------------- +void cmLocalGenerator::AppendFlags(std::string& flags, + const char* newFlags) +{ + if(newFlags && *newFlags) + { + this->AppendFlags(flags, std::string(newFlags)); + } +} + +//---------------------------------------------------------------------------- void cmLocalGenerator::AppendFlagEscape(std::string& flags, const std::string& rawFlag) { - this->AppendFlags(flags, this->EscapeForShell(rawFlag).c_str()); + this->AppendFlags(flags, this->EscapeForShell(rawFlag)); } //---------------------------------------------------------------------------- |