[Cmake-commits] CMake branch, next, updated. v2.8.11.1-2835-gab6f0b9

Stephen Kelly steveire at gmail.com
Sun Jun 30 16:41:51 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  ab6f0b95374343fc1b62ba119e8a36da5b408ab8 (commit)
       via  22b73bf250bf561f1d64c9397f5295e7c4470079 (commit)
      from  46c95e5626a5a11a8cdd1478b86a235db8e2f1d7 (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=ab6f0b95374343fc1b62ba119e8a36da5b408ab8
commit ab6f0b95374343fc1b62ba119e8a36da5b408ab8
Merge: 46c95e5 22b73bf
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 30 16:41:48 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jun 30 16:41:48 2013 -0400

    Merge topic 'INTERFACE_LINK_LIBRARIES-prop' into next
    
    22b73bf Ensure that no policy warning is emitted for normal use of static libraries


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=22b73bf250bf561f1d64c9397f5295e7c4470079
commit 22b73bf250bf561f1d64c9397f5295e7c4470079
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 30 22:34:00 2013 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 30 22:40:53 2013 +0200

    Ensure that no policy warning is emitted for normal use of static libraries
    
    Because the INTERFACE_LINK_LIBRARIES property is now populated unconditionally,
    we need to compare the evaluated result of it with the link implementation
    to determine whether to issue the policy warning.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 7f3cf66..442f86f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6172,29 +6172,46 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
     {
     if (newExplicitLibraries)
       {
-      switch(this->GetPolicyStatusCMP0022())
+      cmListFileBacktrace lfbt;
+      cmGeneratorExpression ge(lfbt);
+      cmGeneratorExpressionDAGChecker dagChecker(lfbt, this->GetName(),
+                                            "INTERFACE_LINK_LIBRARIES", 0, 0);
+      std::vector<std::string> ifaceLibs;
+      cmSystemTools::ExpandListArgument(
+          ge.Parse(newExplicitLibraries)->Evaluate(
+                                          this->Makefile,
+                                          config,
+                                          false,
+                                          headTarget,
+                                          this, &dagChecker), ifaceLibs);
+      LinkImplementation const* impl = this->GetLinkImplementation(config,
+                                                                headTarget);
+      if (ifaceLibs != impl->Libraries)
         {
-        case cmPolicies::WARN:
+        switch(this->GetPolicyStatusCMP0022())
           {
-          cmOStringStream w;
-          w << (this->Makefile->GetPolicies()
-                ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
-            << "Static library target \"" << this->GetName() << "\" has a "
-              "INTERFACE_LINK_LIBRARIES property.  This should be preferred "
-              "as the source of the link interface for this library.  "
-              "Ignoring the property and using the link implementation "
-              "as the link interface instead.";
-          this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+          case cmPolicies::WARN:
+            {
+            cmOStringStream w;
+            w << (this->Makefile->GetPolicies()
+                  ->GetPolicyWarning(cmPolicies::CMP0022)) << "\n"
+              << "Static library target \"" << this->GetName() << "\" has a "
+                "INTERFACE_LINK_LIBRARIES property.  This should be preferred "
+                "as the source of the link interface for this library.  "
+                "Ignoring the property and using the link implementation "
+                "as the link interface instead.";
+            this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+            }
+            // Fall through
+          case cmPolicies::OLD:
+            break;
+          case cmPolicies::REQUIRED_IF_USED:
+          case cmPolicies::REQUIRED_ALWAYS:
+          case cmPolicies::NEW:
+            explicitLibraries = newExplicitLibraries;
+            linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
+            break;
           }
-          // Fall through
-        case cmPolicies::OLD:
-          break;
-        case cmPolicies::REQUIRED_IF_USED:
-        case cmPolicies::REQUIRED_ALWAYS:
-        case cmPolicies::NEW:
-          explicitLibraries = newExplicitLibraries;
-          linkIfaceProp = "INTERFACE_LINK_LIBRARIES";
-          break;
         }
       }
     }
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake
new file mode 100644
index 0000000..7542a14
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake
@@ -0,0 +1,8 @@
+
+project(CMP0022-NOWARN-static)
+
+add_library(foo STATIC empty.cpp)
+add_library(bar STATIC empty.cpp)
+add_library(bat STATIC empty.cpp)
+target_link_libraries(foo bar)
+target_link_libraries(bar bat)
diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
index 9c41814..6b014e3 100644
--- a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
@@ -3,5 +3,6 @@ include(RunCMake)
 run_cmake(CMP0022-WARN)
 run_cmake(CMP0022-WARN-tll)
 run_cmake(CMP0022-WARN-static)
+run_cmake(CMP0022-NOWARN-static)
 run_cmake(CMP0022-export)
 run_cmake(CMP0022-install-export)

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

Summary of changes:
 Source/cmTarget.cxx                                |   57 +++++++++++++-------
 .../CMP0022/CMP0022-NOWARN-static-stderr.txt       |    1 +
 Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake |    8 +++
 Tests/RunCMake/CMP0022/RunCMakeTest.cmake          |    1 +
 4 files changed, 47 insertions(+), 20 deletions(-)
 create mode 100644 Tests/RunCMake/CMP0022/CMP0022-NOWARN-static-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0022/CMP0022-NOWARN-static.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list