diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index b22f8f7a53..5c365c4e90 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -987,7 +987,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements( this->GeneratorTarget->GetExternalObjects(externalObjects, config); for (cmSourceFile const* sf : externalObjects) { auto objectFileName = this->GetGlobalGenerator()->ExpandCFGIntDir( - this->GetSourceFilePath(sf), config); + this->ConvertToNinjaPath(sf->GetFullPath()), config); if (!cmSystemTools::StringEndsWith(objectFileName, cmToCStr(pchExtension))) { this->Configs[config].Objects.push_back(objectFileName);