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
...
This commit is contained in:
Brad King
2016-08-30 09:29:53 -04:00
committed by CMake Topic Stage
25 changed files with 346 additions and 387 deletions
+13 -10
View File
@@ -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();