summaryrefslogtreecommitdiffstats
path: root/Source/cmCommonTargetGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmCommonTargetGenerator.cxx')
-rw-r--r--Source/cmCommonTargetGenerator.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 76ed038..b5688a8 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -426,3 +426,35 @@ std::string cmCommonTargetGenerator::GetManifests()
return cmJoin(manifests, " ");
}
+
+void cmCommonTargetGenerator
+::AppendOSXVerFlag(std::string& flags, const std::string& lang,
+ const char* name, bool so)
+{
+ // Lookup the flag to specify the version.
+ std::string fvar = "CMAKE_";
+ fvar += lang;
+ fvar += "_OSX_";
+ fvar += name;
+ fvar += "_VERSION_FLAG";
+ const char* flag = this->Makefile->GetDefinition(fvar);
+
+ // Skip if no such flag.
+ if(!flag)
+ {
+ return;
+ }
+
+ // Lookup the target version information.
+ int major;
+ int minor;
+ int patch;
+ this->GeneratorTarget->GetTargetVersion(so, major, minor, patch);
+ if(major > 0 || minor > 0 || patch > 0)
+ {
+ // Append the flag since a non-zero version is specified.
+ std::ostringstream vflag;
+ vflag << flag << major << "." << minor << "." << patch;
+ this->LocalGenerator->AppendFlags(flags, vflag.str());
+ }
+}