summaryrefslogtreecommitdiff
path: root/Source/cmLocalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-08-30 09:29:53 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2016-08-30 09:29:53 -0400
commite3a4c2e02ceacd302e8bc6a7dc1bc02b29ab2cfc (patch)
treee9facd72c23705a7527a68f44eade8ad20e313fe /Source/cmLocalNinjaGenerator.cxx
parentef58e97362d10877780aed7b6806dd02ce2f4303 (diff)
parent4332131dcca03b262e0dd51352eb2e27522887c8 (diff)
downloadcmake-e3a4c2e02ceacd302e8bc6a7dc1bc02b29ab2cfc.tar.gz
Merge topic 'cleanup-Convert'
4332131d Convert: Make variables a bit more clear 5aca066c Convert: Remove UNCHANGED enum value 146bf926 Convert: Remove 'FULL' conversion 58ba87f8 Convert: Replace Convert(FULL) with equivalent e80314d7 Ninja: Replace ternary with if() 563ac22a Convert: Replace trivial conversion with new method 08be47cf Convert: Replace UNCHANGED conversions with new API call 564d3a1d Convert: Extract ConvertToRelativePath from Convert() 95a659f1 Convert: Replace FULL conversions with equivalent a8c7ccb1 VS: Replace FULL/UNCHANGED conversion with equivalent 5ad25ef4 Convert: Remove NONE conversion ac463841 Convert: Replace uses of Convert(NONE) 998d9ee9 VS: Replace variable with an if() ee49f006 Makefiles: Replace ternaries with if()s 51f7dcb0 Makefiles: Inline MakeLauncher into only caller ba4ba7c3 Makefiles: Simplify MakeLauncher return value ...
Diffstat (limited to 'Source/cmLocalNinjaGenerator.cxx')
-rw-r--r--Source/cmLocalNinjaGenerator.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 4200e5d25d..d15ee220e9 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -41,7 +41,7 @@ void cmLocalNinjaGenerator::Generate()
{
// Compute the path to use when referencing the current output
// directory from the top output directory.
- this->HomeRelativeOutputPath = this->Convert(
+ this->HomeRelativeOutputPath = this->ConvertToRelativePath(
this->GetCurrentBinaryDirectory(), cmOutputConverter::HOME_OUTPUT);
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath = "";
@@ -132,9 +132,11 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
std::string const& path, cmOutputConverter::OutputFormat format,
bool forceFullPaths)
{
- return this->Convert(path, forceFullPaths ? cmOutputConverter::FULL
- : cmOutputConverter::HOME_OUTPUT,
- format);
+ if (forceFullPaths) {
+ return this->ConvertToOutputFormat(cmSystemTools::CollapseFullPath(path),
+ format);
+ }
+ return this->Convert(path, cmOutputConverter::HOME_OUTPUT, format);
}
// Private methods.
@@ -487,12 +489,13 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
std::string output;
const std::vector<std::string>& outputs = ccg.GetOutputs();
if (!outputs.empty()) {
- cmOutputConverter::RelativeRoot relative_root =
- ccg.GetWorkingDirectory().empty() ? cmOutputConverter::START_OUTPUT
- : cmOutputConverter::NONE;
-
- output =
- this->Convert(outputs[0], relative_root, cmOutputConverter::SHELL);
+ if (ccg.GetWorkingDirectory().empty()) {
+ output = this->Convert(outputs[0], cmOutputConverter::START_OUTPUT,
+ cmOutputConverter::SHELL);
+ } else {
+ output =
+ this->ConvertToOutputFormat(outputs[0], cmOutputConverter::SHELL);
+ }
}
vars.Output = output.c_str();