From f212615d3e799edc57128bccdc501120d753c6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Mon, 4 Nov 2013 13:18:47 +0100 Subject: [PATCH] Ninja: don't parse empty string --- Source/cmNinjaTargetGenerator.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index a6f8159c8..26eadbe52 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, "", "$DEP_FILE"); - cmSystemTools::ReplaceString(depfileFlags, "", "$out"); - cmSystemTools::ReplaceString(depfileFlags, "", - mf->GetDefinition("CMAKE_C_COMPILER")); - flags += " " + depfileFlags; + if (!depfileFlags.empty()) + { + cmSystemTools::ReplaceString(depfileFlags, "", "$DEP_FILE"); + cmSystemTools::ReplaceString(depfileFlags, "", "$out"); + cmSystemTools::ReplaceString(depfileFlags, "", + mf->GetDefinition("CMAKE_C_COMPILER")); + flags += " " + depfileFlags; + } } vars.Flags = flags.c_str();