diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2020-03-23 17:02:11 (GMT) |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2020-03-23 20:34:19 (GMT) |
commit | 5d4bab500e93052630163577815695ac3f47ba7b (patch) | |
tree | ce08a20d9e4a6cddf8f843c9f8e5c49eecb69781 /Source/cmLocalGenerator.cxx | |
parent | d8622fbd0fe1ad7db1e22089464342f329426e9e (diff) | |
download | CMake-5d4bab500e93052630163577815695ac3f47ba7b.zip CMake-5d4bab500e93052630163577815695ac3f47ba7b.tar.gz CMake-5d4bab500e93052630163577815695ac3f47ba7b.tar.bz2 |
Avoid consecutive whitespace in rules
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index a7799b6..62b8052 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -877,7 +877,7 @@ std::string cmLocalGenerator::GetIncludeFlags( if ((sep[0] != ' ') && !flags.empty() && flags.back() == sep[0]) { flags.back() = ' '; } - return flags; + return cmTrimWhitespace(flags); } void cmLocalGenerator::AddCompileOptions(std::string& flags, @@ -2396,7 +2396,9 @@ void cmLocalGenerator::AddConfigVariableFlags(std::string& flags, void cmLocalGenerator::AppendFlags(std::string& flags, const std::string& newFlags) const { - if (!newFlags.empty()) { + bool allSpaces = std::all_of(newFlags.begin(), newFlags.end(), cmIsSpace); + + if (!newFlags.empty() && !allSpaces) { if (!flags.empty()) { flags += " "; } |