summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-05-19 14:41:27 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-05-19 14:41:27 (GMT)
commite0da6c3b562f7fd25b83b00c432f016439c24c22 (patch)
tree43e44454dbdf69f2caffe587a270e1446a2c7d2b /Source/cmNinjaTargetGenerator.cxx
parent43a456e1351fc6c2aca088a55855b7f7c501c100 (diff)
parenteb076692459a8d4cc214156af3553c36309bdce3 (diff)
downloadCMake-e0da6c3b562f7fd25b83b00c432f016439c24c22.zip
CMake-e0da6c3b562f7fd25b83b00c432f016439c24c22.tar.gz
CMake-e0da6c3b562f7fd25b83b00c432f016439c24c22.tar.bz2
Merge topic 'ninja-output-path-prefix'
eb076692 Tests: Select RunCMake.Ninja test cases based on ninja version 8a862a4d Ninja: Support embedding of CMake as subninja project 038e7716 Ninja: Pass all build paths through a central method 7c26a6a2 Ninja: Fix path to soname-d target file ac3cdd9a Ninja: Convert object file names to ninja paths earlier d4381cb1 Ninja: Convert link library file names like all other output paths 0397c92a Ninja: Pre-compute "CMakeCache.txt" build target name 3b3ecdfa Ninja: Pre-compute "all" build target name 5ca72750 Ninja: Simplify generation of custom target logical path
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index c214c8a..4d58242 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -521,8 +521,10 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
std::string const language = source->GetLanguage();
std::string const sourceFileName =
language == "RC" ? source->GetFullPath() : this->GetSourceFilePath(source);
- std::string const objectDir = this->GeneratorTarget->GetSupportDirectory();
- std::string const objectFileName = this->GetObjectFilePath(source);
+ std::string const objectDir =
+ this->ConvertToNinjaPath(this->GeneratorTarget->GetSupportDirectory());
+ std::string const objectFileName =
+ this->ConvertToNinjaPath(this->GetObjectFilePath(source));
std::string const objectFileDir =
cmSystemTools::GetFilenamePath(objectFileName);
@@ -582,9 +584,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
EnsureParentDirectoryExists(objectFileName);
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
- ConvertToNinjaPath(objectDir), cmLocalGenerator::SHELL);
+ objectDir, cmLocalGenerator::SHELL);
vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
- ConvertToNinjaPath(objectFileDir), cmLocalGenerator::SHELL);
+ objectFileDir, cmLocalGenerator::SHELL);
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(),
vars);
@@ -667,10 +669,12 @@ void cmNinjaTargetGenerator::EnsureDirectoryExists(
if (cmSystemTools::FileIsFullPath(path.c_str())) {
cmSystemTools::MakeDirectory(path.c_str());
} else {
- const std::string fullPath = std::string(this->GetGlobalGenerator()
- ->GetCMakeInstance()
- ->GetHomeOutputDirectory()) +
- "/" + path;
+ cmGlobalNinjaGenerator* gg = this->GetGlobalGenerator();
+ std::string fullPath =
+ std::string(gg->GetCMakeInstance()->GetHomeOutputDirectory());
+ // Also ensures their is a trailing slash.
+ gg->StripNinjaOutputPathPrefixAsSuffix(fullPath);
+ fullPath += path;
cmSystemTools::MakeDirectory(fullPath.c_str());
}
}