Ninja: complete MinGW support
This commit is contained in:
parent
7b91c3dfac
commit
38aa9e97f2
@ -179,16 +179,8 @@ cmNinjaNormalTargetGenerator
|
|||||||
responseFlag += rspfile;
|
responseFlag += rspfile;
|
||||||
vars.Objects = responseFlag.c_str();
|
vars.Objects = responseFlag.c_str();
|
||||||
}
|
}
|
||||||
std::string objdir =
|
|
||||||
this->GetLocalGenerator()->GetHomeRelativeOutputPath();
|
vars.ObjectDir = "$OBJECT_DIR";
|
||||||
objdir += objdir.empty() ? "" : "/";
|
|
||||||
objdir += cmake::GetCMakeFilesDirectoryPostSlash();
|
|
||||||
objdir += this->GetTargetName();
|
|
||||||
objdir += ".dir";
|
|
||||||
objdir = this->GetLocalGenerator()->Convert(objdir.c_str(),
|
|
||||||
cmLocalGenerator::START_OUTPUT,
|
|
||||||
cmLocalGenerator::SHELL);
|
|
||||||
vars.ObjectDir = objdir.c_str();
|
|
||||||
vars.Target = "$out";
|
vars.Target = "$out";
|
||||||
vars.SONameFlag = "$SONAME_FLAG";
|
vars.SONameFlag = "$SONAME_FLAG";
|
||||||
vars.TargetSOName = "$SONAME";
|
vars.TargetSOName = "$SONAME";
|
||||||
@ -433,10 +425,24 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
|
|||||||
EnsureParentDirectoryExists(path);
|
EnsureParentDirectoryExists(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
path = this->GetLocalGenerator()->ConvertToOutputFormat(
|
// TODO move to GetTargetPDB
|
||||||
this->GetTargetPDB().c_str(), cmLocalGenerator::SHELL);
|
cmMakefile* mf = this->GetMakefile();
|
||||||
vars["TARGET_PDB"] = path;
|
if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
|
||||||
EnsureParentDirectoryExists(path);
|
mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
|
||||||
|
{
|
||||||
|
path = this->GetTargetPDB();
|
||||||
|
vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||||
|
ConvertToNinjaPath(path.c_str()).c_str(),
|
||||||
|
cmLocalGenerator::SHELL);
|
||||||
|
EnsureParentDirectoryExists(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
|
||||||
|
{
|
||||||
|
path = GetTarget()->GetSupportDirectory();
|
||||||
|
vars["OBJECT_DIR"] = ConvertToNinjaPath(path.c_str());
|
||||||
|
EnsureDirectoryExists(path);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<cmCustomCommand> *cmdLists[3] = {
|
std::vector<cmCustomCommand> *cmdLists[3] = {
|
||||||
&this->GetTarget()->GetPreBuildCommands(),
|
&this->GetTarget()->GetPreBuildCommands(),
|
||||||
|
@ -301,7 +301,7 @@ std::string cmNinjaTargetGenerator::GetTargetPDB() const
|
|||||||
targetFullPathPDB += this->Target->GetPDBName(this->GetConfigName());
|
targetFullPathPDB += this->Target->GetPDBName(this->GetConfigName());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ConvertToNinjaPath(targetFullPathPDB.c_str());
|
return targetFullPathPDB.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -507,8 +507,16 @@ cmNinjaTargetGenerator
|
|||||||
cmNinjaVars vars;
|
cmNinjaVars vars;
|
||||||
vars["FLAGS"] = this->ComputeFlagsForObject(source, language);
|
vars["FLAGS"] = this->ComputeFlagsForObject(source, language);
|
||||||
vars["DEFINES"] = this->ComputeDefines(source, language);
|
vars["DEFINES"] = this->ComputeDefines(source, language);
|
||||||
vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
|
||||||
this->GetTargetPDB().c_str(), cmLocalGenerator::SHELL);
|
// TODO move to GetTargetPDB
|
||||||
|
cmMakefile* mf = this->GetMakefile();
|
||||||
|
if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
|
||||||
|
mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
|
||||||
|
{
|
||||||
|
vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
|
||||||
|
ConvertToNinjaPath(GetTargetPDB().c_str()).c_str(),
|
||||||
|
cmLocalGenerator::SHELL);
|
||||||
|
}
|
||||||
|
|
||||||
if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS"))
|
if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS"))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user