summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-15 19:57:19 (GMT)
committerBrad King <brad.king@kitware.com>2015-09-17 14:21:32 (GMT)
commitd488b5c9764805222d33d50cc070fd4f71aab262 (patch)
treea6ea9cc2b93a910ae813b4235c087cba4357dfec /Source/cmNinjaNormalTargetGenerator.cxx
parent6d620f5ad7fc9767a7232659cde1d7c9abf78285 (diff)
downloadCMake-d488b5c9764805222d33d50cc070fd4f71aab262.zip
CMake-d488b5c9764805222d33d50cc070fd4f71aab262.tar.gz
CMake-d488b5c9764805222d33d50cc070fd4f71aab262.tar.bz2
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.
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index b855bea..f62f8ad 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -579,11 +579,12 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
vars["TARGET_PDB"] = base + suffix + dbg_suffix;
}
+ const std::string objPath = GetTarget()->GetSupportDirectory();
+ vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath);
+ EnsureDirectoryExists(objPath);
+
if (this->GetGlobalGenerator()->IsGCCOnWindows())
{
- const std::string objPath = GetTarget()->GetSupportDirectory();
- vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath);
- EnsureDirectoryExists(objPath);
// 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(), '\\', '/');