summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorChaoren Lin <chaorenl@google.com>2016-08-05 23:51:56 (GMT)
committerBrad King <brad.king@kitware.com>2016-08-08 17:55:29 (GMT)
commit955c2a630aae9b925b468e98e7c323384d943cb0 (patch)
treea7169d3cddba7f4f2c6e3555ff1f83b8150c49cc /Source/cmNinjaTargetGenerator.cxx
parentee9d4feb67f01686c270d3db584dfccaefd14b47 (diff)
downloadCMake-955c2a630aae9b925b468e98e7c323384d943cb0.zip
CMake-955c2a630aae9b925b468e98e7c323384d943cb0.tar.gz
CMake-955c2a630aae9b925b468e98e7c323384d943cb0.tar.bz2
Ninja: Use full path for all source files
This is consistent with the behavior of the Makefile generators. Relative paths are difficult for an IDE to parse the output of a build error.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 855a243..1466f8a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -305,7 +305,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
vars.RuleLauncher = "RULE_LAUNCH_COMPILE";
vars.CMTarget = this->GetGeneratorTarget();
vars.Language = lang.c_str();
- vars.Source = "$in";
+ vars.Source = "$IN_ABS";
vars.Object = "$out";
vars.Defines = "$DEFINES";
vars.Includes = "$INCLUDES";
@@ -529,8 +529,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
cmSourceFile const* source, bool writeOrderDependsTargetForTarget)
{
std::string const language = source->GetLanguage();
- std::string const sourceFileName =
- language == "RC" ? source->GetFullPath() : this->GetSourceFilePath(source);
+ std::string const sourceFileName = this->GetSourceFilePath(source);
std::string const objectDir =
this->ConvertToNinjaPath(this->GeneratorTarget->GetSupportDirectory());
std::string const objectFileName =
@@ -539,6 +538,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
cmSystemTools::GetFilenamePath(objectFileName);
cmNinjaVars vars;
+ vars["IN_ABS"] = this->GetLocalGenerator()->ConvertToOutputFormat(
+ source->GetFullPath(), cmOutputConverter::SHELL);
vars["FLAGS"] = this->ComputeFlagsForObject(source, language);
vars["DEFINES"] = this->ComputeDefines(source, language);
vars["INCLUDES"] = this->GetIncludes(language);