[Cmake-commits] CMake branch, next, updated. v2.8.12-4807-g8cf028b

Brad King brad.king at kitware.com
Sun Nov 3 07:01:37 EST 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  8cf028b99d19e47d8f299688559b23c4241bc215 (commit)
       via  c9a2c99cf52220bd6092f8aef333d39f79aa5a49 (commit)
       via  9b558894e8f3d84214d407b0c055049d8b1f93b7 (commit)
      from  1acf71f292cdf14bcf1d9b7ed5441f15bf4cc8b9 (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=8cf028b99d19e47d8f299688559b23c4241bc215
commit 8cf028b99d19e47d8f299688559b23c4241bc215
Merge: 1acf71f c9a2c99
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sun Nov 3 07:01:20 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Nov 3 07:01:20 2013 -0500

    Merge topic 'policy-CMP0022-fixes-for-master' into next
    
    c9a2c99 Merge branch 'policy-CMP0022-fixes' into policy-CMP0022-fixes-for-master
    9b55889 CMP0022: Warn about a given target at most once


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9a2c99cf52220bd6092f8aef333d39f79aa5a49
commit c9a2c99cf52220bd6092f8aef333d39f79aa5a49
Merge: e9f353a 9b55889
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sun Nov 3 06:53:31 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sun Nov 3 06:53:31 2013 -0500

    Merge branch 'policy-CMP0022-fixes' into policy-CMP0022-fixes-for-master

diff --cc Source/cmTarget.cxx
index 26c87e7,7bdf60f..d9d79fa
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@@ -81,11 -83,15 +81,12 @@@ class cmTargetInternal
  public:
    cmTargetInternals()
      {
+     this->PolicyWarnedCMP0022 = false;
      this->SourceFileFlagsConstructed = false;
      }
 -  cmTargetInternals(cmTargetInternals const& r)
 +  cmTargetInternals(cmTargetInternals const&)
      {
      this->SourceFileFlagsConstructed = false;
 -    // Only some of these entries are part of the object state.
 -    // Others not copied here are result caches.
 -    this->SourceEntries = r.SourceEntries;
      }
    ~cmTargetInternals();
    typedef cmTarget::SourceFileFlags SourceFileFlags;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9b558894e8f3d84214d407b0c055049d8b1f93b7
commit 9b558894e8f3d84214d407b0c055049d8b1f93b7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Sun Nov 3 06:45:21 2013 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Sun Nov 3 06:52:58 2013 -0500

    CMP0022: Warn about a given target at most once
    
    Since cmTarget::ComputeLinkInterface is called separately for each
    "head" target that links a target, the warning we produce when
    CMP0022 is not set could be repeated.  Add explicit logic to allow
    the warning to appear at most once.  Multiple copies of the warning
    for the same target are almost always identical and therefore
    redundant.  In the rare case that two copies of the warning are
    different, the second can appear in a future run after the first
    is fixed.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 3365caf..7bdf60f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -83,6 +83,7 @@ class cmTargetInternals
 public:
   cmTargetInternals()
     {
+    this->PolicyWarnedCMP0022 = false;
     this->SourceFileFlagsConstructed = false;
     }
   cmTargetInternals(cmTargetInternals const& r)
@@ -109,6 +110,7 @@ public:
   typedef std::map<TargetConfigPair, OptionalLinkInterface>
                                                           LinkInterfaceMapType;
   LinkInterfaceMapType LinkInterfaceMap;
+  bool PolicyWarnedCMP0022;
 
   typedef std::map<cmStdString, cmTarget::OutputInfo> OutputInfoMapType;
   OutputInfoMapType OutputInfoMap;
@@ -6433,7 +6435,8 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
       }
     }
 
-  if(explicitLibraries && this->PolicyStatusCMP0022 == cmPolicies::WARN)
+  if(explicitLibraries && this->PolicyStatusCMP0022 == cmPolicies::WARN &&
+     !this->Internal->PolicyWarnedCMP0022)
     {
     // Compare the explicitly set old link interface properties to the
     // preferred new link interface property one and warn if different.
@@ -6455,6 +6458,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
         linkIfaceProp << ":\n"
         "  " << (explicitLibraries ? explicitLibraries : "(empty)") << "\n";
       this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+      this->Internal->PolicyWarnedCMP0022 = true;
       }
     }
 
@@ -6544,7 +6548,8 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
       iface.Languages = impl->Languages;
       }
 
-    if(this->PolicyStatusCMP0022 == cmPolicies::WARN)
+    if(this->PolicyStatusCMP0022 == cmPolicies::WARN &&
+       !this->Internal->PolicyWarnedCMP0022)
       {
       // Compare the link implementation fallback link interface to the
       // preferred new link interface property and warn if different.
@@ -6603,6 +6608,7 @@ bool cmTarget::ComputeLinkInterface(const char* config, LinkInterface& iface,
           "Link implementation:\n"
           "  " << oldLibraries << "\n";
         this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+        this->Internal->PolicyWarnedCMP0022 = true;
         }
       }
     }
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt
new file mode 100644
index 0000000..10f3293
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe-stderr.txt
@@ -0,0 +1 @@
+^$
diff --git a/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake
new file mode 100644
index 0000000..b0268c8
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/CMP0022-NOWARN-exe.cmake
@@ -0,0 +1,7 @@
+enable_language(CXX)
+
+add_library(testLib empty_vs6_1.cpp)
+add_executable(testExe empty_vs6_2.cpp)
+target_link_libraries(testExe testLib)
+
+export(TARGETS testExe FILE "${CMAKE_CURRENT_BINARY_DIR}/cmp0022NOWARN-exe.cmake")
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
index f849be2..2f7dfbf 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt
@@ -1,4 +1,4 @@
-CMake Warning \(dev\) in CMakeLists.txt:
+^CMake Warning \(dev\) in CMakeLists.txt:
   Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES defines the link
   interface.  Run "cmake --help-policy CMP0022" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
diff --git a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
index 24b7f45..fe7e858 100644
--- a/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
+++ b/Tests/RunCMake/CMP0022/CMP0022-WARN.cmake
@@ -9,3 +9,8 @@ set_property(TARGET bar PROPERTY LINK_INTERFACE_LIBRARIES bat)
 
 add_library(user empty.cpp)
 target_link_libraries(user bar)
+
+# Use "bar" again with a different "head" target to check
+# that the warning does not appear again.
+add_library(user2 empty_vs6_3.cpp)
+target_link_libraries(user2 bar)
diff --git a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
index 45b56e4..2781d20 100644
--- a/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0022/RunCMakeTest.cmake
@@ -4,6 +4,7 @@ run_cmake(CMP0022-WARN)
 run_cmake(CMP0022-WARN-tll)
 run_cmake(CMP0022-WARN-static)
 run_cmake(CMP0022-WARN-empty-old)
+run_cmake(CMP0022-NOWARN-exe)
 run_cmake(CMP0022-NOWARN-shared)
 run_cmake(CMP0022-NOWARN-static)
 run_cmake(CMP0022-NOWARN-static-link_libraries)
diff --git a/Tests/RunCMake/CMP0022/empty_vs6_4.cpp b/Tests/RunCMake/CMP0022/empty_vs6_4.cpp
new file mode 100644
index 0000000..7efedab
--- /dev/null
+++ b/Tests/RunCMake/CMP0022/empty_vs6_4.cpp
@@ -0,0 +1 @@
+#include "empty.cpp"

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

Summary of changes:
 Source/cmTarget.cxx                                |   10 ++++++++--
 ...ed-stderr.txt => CMP0022-NOWARN-exe-stderr.txt} |    0
 ...2-export-exe.cmake => CMP0022-NOWARN-exe.cmake} |    4 +---
 Tests/RunCMake/CMP0022/CMP0022-WARN-stderr.txt     |    2 +-
 Tests/RunCMake/CMP0022/CMP0022-WARN.cmake          |    5 +++++
 Tests/RunCMake/CMP0022/RunCMakeTest.cmake          |    1 +
 .../CMP0022/{empty_vs6_1.cpp => empty_vs6_4.cpp}   |    0
 7 files changed, 16 insertions(+), 6 deletions(-)
 copy Tests/RunCMake/CMP0022/{CMP0022-NOWARN-shared-stderr.txt => CMP0022-NOWARN-exe-stderr.txt} (100%)
 copy Tests/RunCMake/CMP0022/{CMP0022-export-exe.cmake => CMP0022-NOWARN-exe.cmake} (81%)
 copy Tests/RunCMake/CMP0022/{empty_vs6_1.cpp => empty_vs6_4.cpp} (100%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list