Skip to content
Snippets Groups Projects
Commit d2c764ad authored by Brad King's avatar Brad King
Browse files

Ninja: Fix module .def file path conversion

Refactoring in commit a2514f15 (Simplify cmNinjaTargetGenerator using
cmGeneratorTarget, 2012-03-13) accidentally removed mapping of .def file
paths through ConvertToNinjaPath (via GetSourceFilePath).  Take the
ModuleDefinitionFile value from cmGeneratorTarget and map it correctly
through ConvertToNinjaPath.

In addition to generating cleaner paths in the ninja build files this
correctly links up references to a generated .def file with the custom
command output that produces it.
parent a2514f15
No related branches found
No related tags found
No related merge requests found
......@@ -234,9 +234,9 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
std::transform(deps.begin(), deps.end(), result.begin(), MapToNinjaPath());
// Add a dependency on the link definitions file, if any.
if(!this->GeneratorTarget->ModuleDefinitionFile.empty())
if(!this->ModuleDefinitionFile.empty())
{
result.push_back(this->GeneratorTarget->ModuleDefinitionFile);
result.push_back(this->ModuleDefinitionFile);
}
return result;
......@@ -400,6 +400,11 @@ cmNinjaTargetGenerator
{
this->WriteObjectBuildStatement(*si);
}
if(!this->GeneratorTarget->ModuleDefinitionFile.empty())
{
this->ModuleDefinitionFile = this->ConvertToNinjaPath(
this->GeneratorTarget->ModuleDefinitionFile.c_str());
}
this->GetBuildFileStream() << "\n";
}
......@@ -478,7 +483,7 @@ void
cmNinjaTargetGenerator
::AddModuleDefinitionFlag(std::string& flags)
{
if(this->GeneratorTarget->ModuleDefinitionFile.empty())
if(this->ModuleDefinitionFile.empty())
{
return;
}
......@@ -495,6 +500,6 @@ cmNinjaTargetGenerator
// vs6's "cl -link" pass it to the linker.
std::string flag = defFileFlag;
flag += (this->LocalGenerator->ConvertToLinkReference(
this->GeneratorTarget->ModuleDefinitionFile.c_str()));
this->ModuleDefinitionFile.c_str()));
this->LocalGenerator->AppendFlags(flags, flag.c_str());
}
......@@ -118,6 +118,9 @@ private:
cmLocalNinjaGenerator* LocalGenerator;
/// List of object files for this target.
cmNinjaDeps Objects;
// The windows module definition source file (.def), if any.
std::string ModuleDefinitionFile;
};
#endif // ! cmNinjaTargetGenerator_h
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment