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  ab65a1e18599219c644889c4d4cb1b45c0dc8383 (commit)
       via  d96271d9e14354ffb93f80a5ba85fb337767a6c5 (commit)
       via  7f1cd3280cf484b5d565a12ae57022de018faa57 (commit)
       via  2597bcf831dae6a0a7a212607ea4b926ec6b10e0 (commit)
      from  f90c7ba54f1a9a61e930292207d3387df40b2dad (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=ab65a1e18599219c644889c4d4cb1b45c0dc8383
commit ab65a1e18599219c644889c4d4cb1b45c0dc8383
Merge: f90c7ba d96271d
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Thu Oct 6 16:35:44 2016 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Thu Oct 6 16:35:44 2016 -0400

    Merge topic 'CMP0065-LINK_FLAGS' into next
    
    d96271d9 CMP0065: Put computed flags into LINK_FLAGS not LINK_LIBRARIES
    7f1cd328 cmLocalGenerator: Rename local variable to be more appropriate
    2597bcf8 cmLocalGenerator: Extract policy handling into a method


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d96271d9e14354ffb93f80a5ba85fb337767a6c5
commit d96271d9e14354ffb93f80a5ba85fb337767a6c5
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Thu Oct 6 22:25:44 2016 +0200
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Thu Oct 6 22:33:01 2016 +0200

    CMP0065: Put computed flags into LINK_FLAGS not LINK_LIBRARIES
    
    These flags are redundant anyway in the NEW case of the policy, and
    could be merged with CMAKE_EXE_EXPORTS_${lang}_FLAG content for that
    case.  That is deferred to the future, but now at least the similar code
    is located close to each other.

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index a0f6423..a0ff824 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1248,6 +1248,14 @@ void cmLocalGenerator::GetTargetFlags(
         linkFlags += this->Makefile->GetSafeDefinition(exportFlagVar);
         linkFlags += " ";
       }
+
+      std::string cmp0065Flags =
+        this->GetLinkLibsCMP0065(linkLanguage, *target);
+      if (!cmp0065Flags.empty()) {
+        linkFlags += cmp0065Flags;
+        linkFlags += " ";
+      }
+
       const char* targetLinkFlags = target->GetProperty("LINK_FLAGS");
       if (targetLinkFlags) {
         linkFlags += targetLinkFlags;
@@ -1430,8 +1438,6 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& 
linkLibraries,
 
   std::string linkLanguage = cli.GetLinkLanguage();
 
-  std::string linkLibs = this->GetLinkLibsCMP0065(linkLanguage, tgt);
-
   std::string libPathFlag =
     this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
   std::string libPathTerminator =
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx 
b/Source/cmMakefileExecutableTargetGenerator.cxx
index cb20117..42e12ad 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -192,6 +192,11 @@ void 
cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
     this->LocalGenerator->AppendFlags(
       linkFlags, this->Makefile->GetDefinition(export_flag_var));
   }
+
+  this->LocalGenerator->AppendFlags(linkFlags,
+                                    this->LocalGenerator->GetLinkLibsCMP0065(
+                                      linkLanguage, *this->GeneratorTarget));
+
   if (this->GeneratorTarget->GetProperty("LINK_WHAT_YOU_USE")) {
     this->LocalGenerator->AppendFlags(linkFlags, " -Wl,--no-as-needed");
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f1cd3280cf484b5d565a12ae57022de018faa57
commit 7f1cd3280cf484b5d565a12ae57022de018faa57
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Thu Oct 6 22:25:05 2016 +0200
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Thu Oct 6 22:25:05 2016 +0200

    cmLocalGenerator: Rename local variable to be more appropriate

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 6cc03e8..a0f6423 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1531,7 +1531,7 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& 
linkLibraries,
 std::string cmLocalGenerator::GetLinkLibsCMP0065(
   std::string const& linkLanguage, cmGeneratorTarget& tgt) const
 {
-  std::string linkLibs;
+  std::string linkFlags;
 
   // Flags to link an executable to shared libraries.
   if (tgt.GetType() == cmState::EXECUTABLE &&
@@ -1571,11 +1571,10 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
       std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
       linkFlagsVar += linkLanguage;
       linkFlagsVar += "_FLAGS";
-      linkLibs = this->Makefile->GetSafeDefinition(linkFlagsVar);
-      linkLibs += " ";
+      linkFlags = this->Makefile->GetSafeDefinition(linkFlagsVar);
     }
   }
-  return linkLibs;
+  return linkFlags;
 }
 
 void cmLocalGenerator::AddArchitectureFlags(std::string& flags,

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2597bcf831dae6a0a7a212607ea4b926ec6b10e0
commit 2597bcf831dae6a0a7a212607ea4b926ec6b10e0
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Tue Oct 4 23:16:27 2016 +0200
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Thu Oct 6 22:17:30 2016 +0200

    cmLocalGenerator: Extract policy handling into a method

diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f24b717..6cc03e8 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -1428,59 +1428,15 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& 
linkLibraries,
   }
   cmComputeLinkInformation& cli = *pcli;
 
-  // Collect library linking flags command line options.
-  std::string linkLibs;
-
   std::string linkLanguage = cli.GetLinkLanguage();
 
+  std::string linkLibs = this->GetLinkLibsCMP0065(linkLanguage, tgt);
+
   std::string libPathFlag =
     this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
   std::string libPathTerminator =
     this->Makefile->GetSafeDefinition("CMAKE_LIBRARY_PATH_TERMINATOR");
 
-  // Flags to link an executable to shared libraries.
-  if (tgt.GetType() == cmState::EXECUTABLE &&
-      this->StateSnapshot.GetState()->GetGlobalPropertyAsBool(
-        "TARGET_SUPPORTS_SHARED_LIBS")) {
-    bool add_shlib_flags = false;
-    switch (tgt.GetPolicyStatusCMP0065()) {
-      case cmPolicies::WARN:
-        if (!tgt.GetPropertyAsBool("ENABLE_EXPORTS") &&
-            this->Makefile->PolicyOptionalWarningEnabled(
-              "CMAKE_POLICY_WARNING_CMP0065")) {
-          std::ostringstream w;
-          /* clang-format off */
-          w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0065) << "\n"
-            "For compatibility with older versions of CMake, "
-            "additional flags may be added to export symbols on all "
-            "executables regardless of their ENABLE_EXPORTS property.";
-          /* clang-format on */
-          this->IssueMessage(cmake::AUTHOR_WARNING, w.str());
-        }
-      case cmPolicies::OLD:
-        // OLD behavior is to always add the flags
-        add_shlib_flags = true;
-        break;
-      case cmPolicies::REQUIRED_IF_USED:
-      case cmPolicies::REQUIRED_ALWAYS:
-        this->IssueMessage(
-          cmake::FATAL_ERROR,
-          cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065));
-      case cmPolicies::NEW:
-        // NEW behavior is to only add the flags if ENABLE_EXPORTS is on
-        add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS");
-        break;
-    }
-
-    if (add_shlib_flags) {
-      std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
-      linkFlagsVar += linkLanguage;
-      linkFlagsVar += "_FLAGS";
-      linkLibs = this->Makefile->GetSafeDefinition(linkFlagsVar);
-      linkLibs += " ";
-    }
-  }
-
   // Append the framework search path flags.
   std::string fwSearchFlagVar = "CMAKE_";
   fwSearchFlagVar += linkLanguage;
@@ -1572,6 +1528,56 @@ void cmLocalGenerator::OutputLinkLibraries(std::string& 
linkLibraries,
   linkLibraries = fout.str();
 }
 
+std::string cmLocalGenerator::GetLinkLibsCMP0065(
+  std::string const& linkLanguage, cmGeneratorTarget& tgt) const
+{
+  std::string linkLibs;
+
+  // Flags to link an executable to shared libraries.
+  if (tgt.GetType() == cmState::EXECUTABLE &&
+      this->StateSnapshot.GetState()->GetGlobalPropertyAsBool(
+        "TARGET_SUPPORTS_SHARED_LIBS")) {
+    bool add_shlib_flags = false;
+    switch (tgt.GetPolicyStatusCMP0065()) {
+      case cmPolicies::WARN:
+        if (!tgt.GetPropertyAsBool("ENABLE_EXPORTS") &&
+            this->Makefile->PolicyOptionalWarningEnabled(
+              "CMAKE_POLICY_WARNING_CMP0065")) {
+          std::ostringstream w;
+          /* clang-format off */
+          w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0065) << "\n"
+            "For compatibility with older versions of CMake, "
+            "additional flags may be added to export symbols on all "
+            "executables regardless of their ENABLE_EXPORTS property.";
+          /* clang-format on */
+          this->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+        }
+      case cmPolicies::OLD:
+        // OLD behavior is to always add the flags
+        add_shlib_flags = true;
+        break;
+      case cmPolicies::REQUIRED_IF_USED:
+      case cmPolicies::REQUIRED_ALWAYS:
+        this->IssueMessage(
+          cmake::FATAL_ERROR,
+          cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065));
+      case cmPolicies::NEW:
+        // NEW behavior is to only add the flags if ENABLE_EXPORTS is on
+        add_shlib_flags = tgt.GetPropertyAsBool("ENABLE_EXPORTS");
+        break;
+    }
+
+    if (add_shlib_flags) {
+      std::string linkFlagsVar = "CMAKE_SHARED_LIBRARY_LINK_";
+      linkFlagsVar += linkLanguage;
+      linkFlagsVar += "_FLAGS";
+      linkLibs = this->Makefile->GetSafeDefinition(linkFlagsVar);
+      linkLibs += " ";
+    }
+  }
+  return linkLibs;
+}
+
 void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
                                             cmGeneratorTarget const* target,
                                             const std::string& lang,
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 19469be..2c1aeac 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -82,6 +82,9 @@ public:
     return this->GlobalGenerator;
   }
 
+  std::string GetLinkLibsCMP0065(std::string const& linkLanguage,
+                                 cmGeneratorTarget& tgt) const;
+
   cmState* GetState() const;
   cmState::Snapshot GetStateSnapshot() const;
 

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

Summary of changes:
 Source/cmLocalGenerator.cxx                    |  103 +++++++++++++-----------
 Source/cmLocalGenerator.h                      |    3 +
 Source/cmMakefileExecutableTargetGenerator.cxx |    5 ++
 3 files changed, 65 insertions(+), 46 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/mailman/listinfo/cmake-commits

Reply via email to