summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaNormalTargetGenerator.cxx
diff options
context:
space:
mode:
authorBruce Stephens <bruce.stephens@isode.com>2016-02-20 19:35:18 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-07 20:03:21 (GMT)
commit9e165a64addbf997d5af58caccd2c93ec2c77a95 (patch)
tree1459a59b92b266d5bac14ad86a149056bcdb6119 /Source/cmNinjaNormalTargetGenerator.cxx
parent1f2b39c6ce390570ab3918b5e1169619394bb669 (diff)
downloadCMake-9e165a64addbf997d5af58caccd2c93ec2c77a95.zip
CMake-9e165a64addbf997d5af58caccd2c93ec2c77a95.tar.gz
CMake-9e165a64addbf997d5af58caccd2c93ec2c77a95.tar.bz2
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>
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 17561b5..c34df3c 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", &gt, vars);
this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]);