diff options
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 20 |
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()); } } |