diff options
author | Brad King <brad.king@kitware.com> | 2013-11-05 13:16:47 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-11-05 13:16:47 (GMT) |
commit | f506a2efbea1f7141e6adff199f1371def139d7a (patch) | |
tree | 46eb4893cdd25eded948175d64f4d4c090ba659b | |
parent | 7ccb8fafdb8982818e55d6f8c57b882af444c52f (diff) | |
parent | f212615d3e799edc57128bccdc501120d753c6ee (diff) | |
download | CMake-f506a2efbea1f7141e6adff199f1371def139d7a.zip CMake-f506a2efbea1f7141e6adff199f1371def139d7a.tar.gz CMake-f506a2efbea1f7141e6adff199f1371def139d7a.tar.bz2 |
Merge topic 'ninja-dont-parse-empty-depsflag'
f212615 Ninja: don't parse empty string
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index a6f8159..26eadbe 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -398,11 +398,14 @@ cmNinjaTargetGenerator depfile = "$DEP_FILE"; const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang; std::string depfileFlags = mf->GetSafeDefinition(flagsName.c_str()); - cmSystemTools::ReplaceString(depfileFlags, "<DEPFILE>", "$DEP_FILE"); - cmSystemTools::ReplaceString(depfileFlags, "<OBJECT>", "$out"); - cmSystemTools::ReplaceString(depfileFlags, "<CMAKE_C_COMPILER>", - mf->GetDefinition("CMAKE_C_COMPILER")); - flags += " " + depfileFlags; + if (!depfileFlags.empty()) + { + cmSystemTools::ReplaceString(depfileFlags, "<DEPFILE>", "$DEP_FILE"); + cmSystemTools::ReplaceString(depfileFlags, "<OBJECT>", "$out"); + cmSystemTools::ReplaceString(depfileFlags, "<CMAKE_C_COMPILER>", + mf->GetDefinition("CMAKE_C_COMPILER")); + flags += " " + depfileFlags; + } } vars.Flags = flags.c_str(); |