From 9e165a64addbf997d5af58caccd2c93ec2c77a95 Mon Sep 17 00:00:00 2001 From: Bruce Stephens Date: Sat, 20 Feb 2016 19:35:18 +0000 Subject: [PATCH] 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 --- Source/cmNinjaNormalTargetGenerator.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 17561b5ab..c34df3cb1 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -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", >, vars); this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]);