Ninja: Always add OBJECT_DIR variable to link rules

The <OBJECT_DIR> placeholder is always available in Makefile
generators so make it available from the Ninja generator too.
This commit is contained in:
Brad King 2015-09-15 15:57:19 -04:00
parent 6d620f5ad7
commit d488b5c976
1 changed files with 4 additions and 3 deletions

View File

@ -579,11 +579,12 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
vars["TARGET_PDB"] = base + suffix + dbg_suffix;
}
if (this->GetGlobalGenerator()->IsGCCOnWindows())
{
const std::string objPath = GetTarget()->GetSupportDirectory();
vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath);
EnsureDirectoryExists(objPath);
if (this->GetGlobalGenerator()->IsGCCOnWindows())
{
// ar.exe can't handle backslashes in rsp files (implicitly used by gcc)
std::string& linkLibraries = vars["LINK_LIBRARIES"];
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');