Merge topic 'compile-OBJECT_FILE_DIR'

8256ccb7 Add OBJECT_FILE_DIR rule placeholder for compilation lines
This commit is contained in:
Brad King 2014-06-06 09:44:53 -04:00 committed by CMake Topic Stage
commit 09c5fdfaa3
4 changed files with 19 additions and 0 deletions

View File

@ -875,6 +875,13 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable,
return replaceValues.ObjectDir; return replaceValues.ObjectDir;
} }
} }
if(replaceValues.ObjectFileDir)
{
if(variable == "OBJECT_FILE_DIR")
{
return replaceValues.ObjectFileDir;
}
}
if(replaceValues.Objects) if(replaceValues.Objects)
{ {
if(variable == "OBJECTS") if(variable == "OBJECTS")

View File

@ -269,6 +269,7 @@ public:
const char* Output; const char* Output;
const char* Object; const char* Object;
const char* ObjectDir; const char* ObjectDir;
const char* ObjectFileDir;
const char* Flags; const char* Flags;
const char* ObjectsQuoted; const char* ObjectsQuoted;
const char* SONameFlag; const char* SONameFlag;

View File

@ -684,6 +684,11 @@ cmMakefileTargetGenerator
cmLocalGenerator::START_OUTPUT, cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL); cmLocalGenerator::SHELL);
vars.ObjectDir = objectDir.c_str(); vars.ObjectDir = objectDir.c_str();
std::string objectFileDir = cmSystemTools::GetFilenamePath(obj);
objectFileDir = this->Convert(objectFileDir,
cmLocalGenerator::START_OUTPUT,
cmLocalGenerator::SHELL);
vars.ObjectFileDir = objectFileDir.c_str();
vars.Flags = flags.c_str(); vars.Flags = flags.c_str();
std::string definesString = "$("; std::string definesString = "$(";

View File

@ -385,6 +385,7 @@ cmNinjaTargetGenerator
vars.TargetPDB = "$TARGET_PDB"; vars.TargetPDB = "$TARGET_PDB";
vars.TargetCompilePDB = "$TARGET_COMPILE_PDB"; vars.TargetCompilePDB = "$TARGET_COMPILE_PDB";
vars.ObjectDir = "$OBJECT_DIR"; vars.ObjectDir = "$OBJECT_DIR";
vars.ObjectFileDir = "$OBJECT_FILE_DIR";
cmMakefile* mf = this->GetMakefile(); cmMakefile* mf = this->GetMakefile();
@ -623,6 +624,10 @@ cmNinjaTargetGenerator
vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat( vars["OBJECT_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(objectDir.c_str()), ConvertToNinjaPath(objectDir.c_str()),
cmLocalGenerator::SHELL); cmLocalGenerator::SHELL);
std::string objectFileDir = cmSystemTools::GetFilenamePath(objectFileName);
vars["OBJECT_FILE_DIR"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(objectFileDir.c_str()),
cmLocalGenerator::SHELL);
this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetTarget(), vars); this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetTarget(), vars);
@ -651,6 +656,7 @@ cmNinjaTargetGenerator
compileObjectVars.Source = escapedSourceFileName.c_str(); compileObjectVars.Source = escapedSourceFileName.c_str();
compileObjectVars.Object = objectFileName.c_str(); compileObjectVars.Object = objectFileName.c_str();
compileObjectVars.ObjectDir = objectDir.c_str(); compileObjectVars.ObjectDir = objectDir.c_str();
compileObjectVars.ObjectFileDir = objectFileDir.c_str();
compileObjectVars.Flags = vars["FLAGS"].c_str(); compileObjectVars.Flags = vars["FLAGS"].c_str();
compileObjectVars.Defines = vars["DEFINES"].c_str(); compileObjectVars.Defines = vars["DEFINES"].c_str();