diff options
author | David Cole <david.cole@kitware.com> | 2012-07-09 18:21:22 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-07-09 18:21:22 (GMT) |
commit | 8947f11d078197e410ddf3235beeda5193fbb59e (patch) | |
tree | 1dd39bd8310ac85f6c3090034dc0308b51ff6c93 /Source/cmNinjaTargetGenerator.cxx | |
parent | f70f55c064d2b3a761a32b84ca39ee25377300c5 (diff) | |
parent | ca403b8c436e25e2fe5de5144fecf7aef8b5de78 (diff) | |
download | CMake-8947f11d078197e410ddf3235beeda5193fbb59e.zip CMake-8947f11d078197e410ddf3235beeda5193fbb59e.tar.gz CMake-8947f11d078197e410ddf3235beeda5193fbb59e.tar.bz2 |
Merge topic 'Ninja-absolute-compile-commands'
ca403b8 Construct the full path before escaping it.
f9383a9 STYLE: Fix line length, remove extra blank line
e30d46e Use full paths in compile_commands.json for out of source builds.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 6157931..4758989 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -534,9 +534,21 @@ cmNinjaTargetGenerator cmLocalGenerator::RuleVariables compileObjectVars; std::string lang = language; compileObjectVars.Language = lang.c_str(); - std::string escapedSourceFileName = + + std::string escapedSourceFileName = sourceFileName; + + if (!cmSystemTools::FileIsFullPath(sourceFileName.c_str())) + { + escapedSourceFileName = cmSystemTools::CollapseFullPath( + escapedSourceFileName.c_str(), + this->GetGlobalGenerator()->GetCMakeInstance()-> + GetHomeOutputDirectory()); + } + + escapedSourceFileName = this->LocalGenerator->ConvertToOutputFormat( - sourceFileName.c_str(), cmLocalGenerator::SHELL); + escapedSourceFileName.c_str(), cmLocalGenerator::SHELL); + compileObjectVars.Source = escapedSourceFileName.c_str(); compileObjectVars.Object = objectFileName.c_str(); compileObjectVars.Flags = vars["FLAGS"].c_str(); |