summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorPeter Kümmel <syntheticpp@gmx.net>2013-11-04 12:18:47 (GMT)
committerPeter Kümmel <syntheticpp@gmx.net>2013-11-04 12:20:27 (GMT)
commitf212615d3e799edc57128bccdc501120d753c6ee (patch)
tree55c7766a3930e0d4bac9f0bf8fa170636c6760eb /Source
parente405380d06052ca7e86ab9ca297f3e89fe866932 (diff)
downloadCMake-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.cxx13
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();