[Cmake-commits] CMake branch, next, updated. v2.8.12-4770-g91405fc

Brad King brad.king at kitware.com
Sat Nov 2 07:22:54 EDT 2013


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  91405fc47d89e43ac1779d4b306c30eaf13b7cbf (commit)
       via  38436d66b13b358026b5cbe16f8925c0478ca6f9 (commit)
       via  948a2ec20c5a7ac39982085ca8ff2c681c621273 (commit)
      from  c3e407f86f45c7afb86caad6a43f3a2c7d4ee0ea (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91405fc47d89e43ac1779d4b306c30eaf13b7cbf
commit 91405fc47d89e43ac1779d4b306c30eaf13b7cbf
Merge: c3e407f 38436d6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Nov 2 07:22:28 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Nov 2 07:22:28 2013 -0400

    Merge branch 'handle-only-plain-tll' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38436d66b13b358026b5cbe16f8925c0478ca6f9
commit 38436d66b13b358026b5cbe16f8925c0478ca6f9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Wed Oct 30 13:21:53 2013 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Nov 2 07:20:25 2013 -0400

    CMP0022: Add test for target_link_libraries plain signature

diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
index 07d7c43..cd174d2 100644
--- a/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/CMakeLists.txt
@@ -25,3 +25,10 @@ target_link_libraries(staticlib1 LINK_PUBLIC staticlib2)
 
 add_executable(staticlib_exe staticlib_exe.cpp)
 target_link_libraries(staticlib_exe staticlib1)
+
+add_library(onlyplainlib1 SHARED onlyplainlib1.cpp)
+add_library(onlyplainlib2 SHARED onlyplainlib2.cpp)
+target_link_libraries(onlyplainlib2 onlyplainlib1)
+
+add_executable(onlyplainlib_user onlyplainlib_user.cpp)
+target_link_libraries(onlyplainlib_user onlyplainlib2)
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.cpp
new file mode 100644
index 0000000..41dc3ce
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.cpp
@@ -0,0 +1,13 @@
+
+#include "onlyplainlib1.h"
+
+OnlyPlainLib1::OnlyPlainLib1()
+  : result(0)
+{
+
+}
+
+int OnlyPlainLib1::GetResult()
+{
+  return result;
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.h
new file mode 100644
index 0000000..c0373ce
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib1.h
@@ -0,0 +1,14 @@
+
+struct
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+OnlyPlainLib1
+{
+  OnlyPlainLib1();
+
+  int GetResult();
+
+private:
+  int result;
+};
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.cpp
new file mode 100644
index 0000000..2865ae9
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.cpp
@@ -0,0 +1,8 @@
+
+#include "onlyplainlib2.h"
+
+OnlyPlainLib1 onlyPlainLib2()
+{
+  OnlyPlainLib1 opl1;
+  return opl1;
+}
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.h
new file mode 100644
index 0000000..74b18a0
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib2.h
@@ -0,0 +1,7 @@
+
+#include "onlyplainlib1.h"
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+OnlyPlainLib1 onlyPlainLib2();
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib_user.cpp b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib_user.cpp
new file mode 100644
index 0000000..0fb7b0a
--- /dev/null
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/onlyplainlib_user.cpp
@@ -0,0 +1,7 @@
+
+#include "onlyplainlib2.h"
+
+int main(int argc, char **argv)
+{
+  return onlyPlainLib2().GetResult();
+}

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=948a2ec20c5a7ac39982085ca8ff2c681c621273
commit 948a2ec20c5a7ac39982085ca8ff2c681c621273
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sat Nov 2 07:15:42 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sat Nov 2 07:20:25 2013 -0400

    CMP0022: Plain target_link_libraries must populate link interface
    
    The CMP0022 NEW behavior is that the INTERFACE_LINK_LIBRARIES property
    exactly defines the link interface.  The plain target_link_libraries
    signature says linking is transitive by default, so it should populate
    the property.
    
    This fixes a regression in 2.8.12.0 that caused target_link_libraries
    to not implement transitive linking in the plain signature once the
    policy CMP0022 is set to NEW.

diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index ef336ea..a30c5e4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -631,6 +631,7 @@ cmExportFileGenerator
 
   if (iface->ImplementationIsInterface)
     {
+    // Policy CMP0022 must not be NEW.
     this->SetImportLinkProperty(suffix, target,
                                 "IMPORTED_LINK_INTERFACE_LIBRARIES",
                                 iface->Libraries, properties, missingTargets);
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ac655da..4425011 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6590,9 +6590,10 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
     }
   else if (this->GetPolicyStatusCMP0022() == cmPolicies::WARN
         || this->GetPolicyStatusCMP0022() == cmPolicies::OLD)
-    // The implementation shouldn't be the interface if CMP0022 is NEW. That
-    // way, the LINK_LIBRARIES property can be set directly without having to
-    // empty the INTERFACE_LINK_LIBRARIES
+    // If CMP0022 is NEW then the plain tll signature sets the
+    // INTERFACE_LINK_LIBRARIES, so if we get here then the project
+    // cleared the property explicitly and we should not fall back
+    // to the link implementation.
     {
     // The link implementation is the default link interface.
     LinkImplementation const* impl = this->GetLinkImplementation(config,
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 863b391..928c550 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -373,6 +373,10 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
         }
     }
 
+  bool oldCMP0022 =
+    (this->Target->GetPolicyStatusCMP0022() == cmPolicies::OLD ||
+     this->Target->GetPolicyStatusCMP0022() == cmPolicies::WARN);
+
   // Handle normal case first.
   if(this->CurrentProcessingState != ProcessingKeywordLinkInterface
       && this->CurrentProcessingState != ProcessingPlainLinkInterface)
@@ -380,7 +384,9 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
     this->Makefile
       ->AddLinkLibraryForTarget(this->Target->GetName(), lib, llt);
     if (this->CurrentProcessingState != ProcessingKeywordPublicInterface
-        && this->CurrentProcessingState != ProcessingPlainPublicInterface)
+        && this->CurrentProcessingState != ProcessingPlainPublicInterface
+        && (this->CurrentProcessingState != ProcessingLinkLibraries
+            || oldCMP0022))
       {
       if (this->Target->GetType() == cmTarget::STATIC_LIBRARY)
         {
@@ -398,11 +404,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib,
   this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
               this->Target->GetDebugGeneratorExpressions(lib, llt).c_str());
 
-  const cmPolicies::PolicyStatus policy22Status
-                      = this->Target->GetPolicyStatusCMP0022();
-
-  if (policy22Status != cmPolicies::OLD
-      && policy22Status != cmPolicies::WARN)
+  if (!oldCMP0022)
     {
     return true;
     }

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list