summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-10-09 12:37:31 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-10-09 12:37:31 (GMT)
commitaa0647ca9c28afb359066819f44eb101e42e8a2f (patch)
tree1d73bf25dc9025e05dd3ff27c44c96ffdebeb761
parentf1049b9a3cf2975288b015ffa47b32228b07d9cc (diff)
parent188c73cb749ae0b248df05baf9ea6227b54864da (diff)
downloadCMake-aa0647ca9c28afb359066819f44eb101e42e8a2f.zip
CMake-aa0647ca9c28afb359066819f44eb101e42e8a2f.tar.gz
CMake-aa0647ca9c28afb359066819f44eb101e42e8a2f.tar.bz2
Merge topic 'ninja-compile-OBJECT_DIR'
188c73c Ninja: also set OBJECT_DIR when compiling
-rw-r--r--Source/cmNinjaTargetGenerator.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 612e047..811ac88 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -368,7 +368,7 @@ cmNinjaTargetGenerator
std::string flags = "$FLAGS";
vars.Defines = "$DEFINES";
vars.TargetPDB = "$TARGET_PDB";
-
+ vars.ObjectDir = "$OBJECT_DIR";
cmMakefile* mf = this->GetMakefile();
@@ -566,6 +566,13 @@ cmNinjaTargetGenerator
vars["DEP_FILE"] = objectFileName + ".d";;
EnsureParentDirectoryExists(objectFileName);
+ std::string objectDir = cmSystemTools::GetFilenamePath(objectFileName);
+ objectDir = this->GetLocalGenerator()->Convert(objectDir.c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL);
+ vars["OBJECT_DIR"] = objectDir;
+
+
this->SetMsvcTargetPdbVariable(vars);
if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS"))
@@ -590,6 +597,7 @@ cmNinjaTargetGenerator
compileObjectVars.Source = escapedSourceFileName.c_str();
compileObjectVars.Object = objectFileName.c_str();
+ compileObjectVars.ObjectDir = objectDir.c_str();
compileObjectVars.Flags = vars["FLAGS"].c_str();
compileObjectVars.Defines = vars["DEFINES"].c_str();