Ninja: Add OS X dylib versioning (#14140)

Teach the Ninja generator to add the `-current_version` and the
`-compatibility_version` flags based on the VERSION and SOVERSION target
properties just as the Makefile generators do.

Signed-off-by: Bruce Stephens <bruce.r.stephens@gmail.com>
This commit is contained in:
Bruce Stephens 2016-02-20 19:35:18 +00:00 committed by Brad King
parent 1f2b39c6ce
commit 9e165a64ad
1 changed files with 10 additions and 0 deletions

View File

@ -504,6 +504,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
} }
} }
// Add OS X version flags, if any.
if(this->GeneratorTarget->GetType() == cmState::SHARED_LIBRARY ||
this->GeneratorTarget->GetType() == cmState::MODULE_LIBRARY)
{
this->AppendOSXVerFlag(vars["LINK_FLAGS"], this->TargetLinkLanguage,
"COMPATIBILITY", true);
this->AppendOSXVerFlag(vars["LINK_FLAGS"], this->TargetLinkLanguage,
"CURRENT", false);
}
this->addPoolNinjaVariable("JOB_POOL_LINK", &gt, vars); this->addPoolNinjaVariable("JOB_POOL_LINK", &gt, vars);
this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]); this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]);