summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalNinjaGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-16 19:30:53 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-17 13:34:06 (GMT)
commit5ca72750c8de3c1c925c433293eb3bc6b3ea234c (patch)
treedc82851cefb615116f687a4f7579a407625110c3 /Source/cmGlobalNinjaGenerator.cxx
parent7d2a0aa76c25d92f1e2a03778f5666bdd7e56b92 (diff)
downloadCMake-5ca72750c8de3c1c925c433293eb3bc6b3ea234c.zip
CMake-5ca72750c8de3c1c925c433293eb3bc6b3ea234c.tar.gz
CMake-5ca72750c8de3c1c925c433293eb3bc6b3ea234c.tar.bz2
Ninja: Simplify generation of custom target logical path
In `AppendTargetOutputs` we generate a logical build target name for each UTILITY command. Simplify the logic to avoid testing the result of `ConvertToNinjaPath`.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 012ef90..a8e02e1 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -836,15 +836,10 @@ void cmGlobalNinjaGenerator::AppendTargetOutputs(
}
case cmState::OBJECT_LIBRARY:
case cmState::UTILITY: {
- std::string path = this->ConvertToNinjaPath(
- target->GetLocalGenerator()->GetCurrentBinaryDirectory());
- if (path.empty() || path == ".")
- outputs.push_back(target->GetName());
- else {
- path += "/";
- path += target->GetName();
- outputs.push_back(path);
- }
+ std::string path =
+ target->GetLocalGenerator()->GetCurrentBinaryDirectory() +
+ std::string("/") + target->GetName();
+ outputs.push_back(this->ConvertToNinjaPath(path));
break;
}