summaryrefslogtreecommitdiffstats
path: root/Source
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 19:57:26 (GMT)
commit1f2b39c6ce390570ab3918b5e1169619394bb669 (patch)
tree750a6ee19cc58ce5408352fc20b06dea69409e1a /Source
parent8256d021c8324779c7269658a094848ebeafb82e (diff)
downloadCMake-1f2b39c6ce390570ab3918b5e1169619394bb669.zip
CMake-1f2b39c6ce390570ab3918b5e1169619394bb669.tar.gz
CMake-1f2b39c6ce390570ab3918b5e1169619394bb669.tar.bz2
cmCommonTargetGenerator: Adopt AppendOSXVerFlag method
Move this method from cmMakefileLibraryTargetGenerator so it can be re-used for the Ninja generator too. Signed-off-by: Bruce Stephens <bruce.r.stephens@gmail.com>
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCommonTargetGenerator.cxx32
-rw-r--r--Source/cmCommonTargetGenerator.h3
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx34
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.h3
4 files changed, 35 insertions, 37 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());
+ }
+}
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 0c17500..bfb6b79 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -79,6 +79,9 @@ protected:
virtual void AddIncludeFlags(std::string& flags,
std::string const& lang) = 0;
+ void AppendOSXVerFlag(std::string& flags, const std::string& lang,
+ const char* name, bool so);
+
typedef std::map<std::string, std::string> ByLanguageMap;
std::string GetFlags(const std::string &l);
ByLanguageMap FlagsByLanguage;
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 1923ea4..435844e 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -841,37 +841,3 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
this->CleanFiles.insert(this->CleanFiles.end(),
libCleanFiles.begin(),libCleanFiles.end());
}
-
-//----------------------------------------------------------------------------
-void
-cmMakefileLibraryTargetGenerator
-::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());
- }
-}
diff --git a/Source/cmMakefileLibraryTargetGenerator.h b/Source/cmMakefileLibraryTargetGenerator.h
index 68980c3..009f15d 100644
--- a/Source/cmMakefileLibraryTargetGenerator.h
+++ b/Source/cmMakefileLibraryTargetGenerator.h
@@ -38,9 +38,6 @@ protected:
// Store the computd framework version for OS X Frameworks.
std::string FrameworkVersion;
-
- void AppendOSXVerFlag(std::string& flags, const std::string& lang,
- const char* name, bool so);
};
#endif