Ninja: Convert object file names to ninja paths earlier

In WriteObjectBuildStatement we pass object file names and directories
to several places that expect paths as Ninja sees them.  Convert them to
Ninja paths before all such uses.
This commit is contained in:
Nicolas Despres 2016-05-14 01:18:20 +02:00 committed by Brad King
parent d4381cb15d
commit ac3cdd9af2
1 changed files with 6 additions and 4 deletions

View File

@ -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);