Merge topic 'ninja-compile-OBJECT_DIR'

188c73c Ninja: also set OBJECT_DIR when compiling
This commit is contained in:
Brad King 2012-10-09 08:37:31 -04:00 committed by CMake Topic Stage
commit aa0647ca9c
1 changed files with 9 additions and 1 deletions

View File

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