[Cmake-commits] CMake branch, next, updated. v3.5.0-rc3-346-g575399a

Brad King brad.king at kitware.com
Mon Mar 7 15:04:57 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  575399afd14cace26a01e1aed65af8ca6bb9f15d (commit)
       via  9e165a64addbf997d5af58caccd2c93ec2c77a95 (commit)
       via  1f2b39c6ce390570ab3918b5e1169619394bb669 (commit)
      from  b6b5792286f9618cb4051585f534feb48f8a1b3f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=575399afd14cace26a01e1aed65af8ca6bb9f15d
commit 575399afd14cace26a01e1aed65af8ca6bb9f15d
Merge: b6b5792 9e165a6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon Mar 7 15:04:56 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Mar 7 15:04:56 2016 -0500

    Merge topic 'ninja-osx-versions' into next
    
    9e165a64 Ninja: Add OS X dylib versioning (#14140)
    1f2b39c6 cmCommonTargetGenerator: Adopt AppendOSXVerFlag method


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9e165a64addbf997d5af58caccd2c93ec2c77a95
commit 9e165a64addbf997d5af58caccd2c93ec2c77a95
Author:     Bruce Stephens <bruce.stephens at isode.com>
AuthorDate: Sat Feb 20 19:35:18 2016 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 7 15:03:21 2016 -0500

    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 at gmail.com>

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"]);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f2b39c6ce390570ab3918b5e1169619394bb669
commit 1f2b39c6ce390570ab3918b5e1169619394bb669
Author:     Bruce Stephens <bruce.stephens at isode.com>
AuthorDate: Sat Feb 20 19:35:18 2016 +0000
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon Mar 7 14:57:26 2016 -0500

    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 at gmail.com>

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

-----------------------------------------------------------------------

Summary of changes:
 Source/cmCommonTargetGenerator.cxx          |   32 +++++++++++++++++++++++++
 Source/cmCommonTargetGenerator.h            |    3 +++
 Source/cmMakefileLibraryTargetGenerator.cxx |   34 ---------------------------
 Source/cmMakefileLibraryTargetGenerator.h   |    3 ---
 Source/cmNinjaNormalTargetGenerator.cxx     |   10 ++++++++
 5 files changed, 45 insertions(+), 37 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list