Ninja: don't parse empty string

This commit is contained in:
Peter Kümmel 2013-11-04 13:18:47 +01:00
parent e405380d06
commit f212615d3e
1 changed files with 8 additions and 5 deletions

View File

@ -398,12 +398,15 @@ cmNinjaTargetGenerator
depfile = "$DEP_FILE";
const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
std::string depfileFlags = mf->GetSafeDefinition(flagsName.c_str());
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();
vars.DependencyFile = depfile.c_str();