diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2013-11-04 12:18:47 (GMT) |
---|---|---|
committer | Peter Kümmel <syntheticpp@gmx.net> | 2013-11-04 12:20:27 (GMT) |
commit | f212615d3e799edc57128bccdc501120d753c6ee (patch) | |
tree | 55c7766a3930e0d4bac9f0bf8fa170636c6760eb /Source | |
parent | e405380d06052ca7e86ab9ca297f3e89fe866932 (diff) | |
download | CMake-f212615d3e799edc57128bccdc501120d753c6ee.zip CMake-f212615d3e799edc57128bccdc501120d753c6ee.tar.gz CMake-f212615d3e799edc57128bccdc501120d753c6ee.tar.bz2 |
Ninja: don't parse empty string
Diffstat (limited to 'Source')
-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(); |