[Cmake-commits] CMake branch, master, updated. v3.10.0-492-g22e67bc

Kitware Robot kwrobot at kitware.com
Fri Dec 1 08:25:06 EST 2017


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, master has been updated
       via  22e67bc6bb138d1fb09555f1fdeaaba14312d3da (commit)
       via  e61c1cf64c4f39b00e0f8ed81466e85c773d9ba2 (commit)
       via  47c326c36bff1669f17ea2d89c49dc9152f8268a (commit)
       via  3c6dab8b72c1a0736a5ddb4c470cf7b7b544ceb1 (commit)
       via  375eca7881bceabf591a4fc278c198657aafbd5e (commit)
       via  3bcaa870078d875b65f17d82661a133f6d5cbdfc (commit)
       via  dd700e9bfb2a498632845e76ce95dd38bb866a7b (commit)
       via  8112059ee7f38f0eb5cdcaba8185aec659abcbfc (commit)
       via  32cfa7b324de799eefb2f7370fb54b700d1a87a5 (commit)
       via  9af5f6727716ab8b9b61815ec67e1c4ffe1213b6 (commit)
       via  b0e2f1415e680337f4b70b19e319efeba0eb6f12 (commit)
       via  85457b63c859f238ef324757f1042cc846cedbc7 (commit)
      from  006a4956a296ed5a9c01fbd5c242c240dc3aac99 (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=22e67bc6bb138d1fb09555f1fdeaaba14312d3da
commit 22e67bc6bb138d1fb09555f1fdeaaba14312d3da
Merge: e61c1cf 8112059
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 1 13:24:05 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Dec 1 08:24:08 2017 -0500

    Merge topic 'simplify_target_link_libraries'
    
    8112059e target_link_libraries: Simplify implementation and add comments.
    b0e2f141 target_link_libraries: Slightly fix some error-messages.
    85457b63 target_link_libraries: Return earlier on some error.
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1531


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e61c1cf64c4f39b00e0f8ed81466e85c773d9ba2
commit e61c1cf64c4f39b00e0f8ed81466e85c773d9ba2
Merge: 47c326c 3bcaa87
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 1 13:22:43 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Dec 1 08:22:49 2017 -0500

    Merge topic 'libuv-raii'
    
    3bcaa870 cmUVHandlePtr: Add uv_process_ptr
    dd700e9b cmUVHandlePtr: Add uv_timer_ptr
    32cfa7b3 cmUVHandlePtr: Move to CMakeLib to make it available everywhere
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1541


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=47c326c36bff1669f17ea2d89c49dc9152f8268a
commit 47c326c36bff1669f17ea2d89c49dc9152f8268a
Merge: 3c6dab8 375eca7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 1 13:18:08 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Dec 1 08:18:12 2017 -0500

    Merge topic 'bootstrap-clang-5'
    
    375eca78 bootstrap: Check support for unordered_map from compiler mode
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1542


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3c6dab8b72c1a0736a5ddb4c470cf7b7b544ceb1
commit 3c6dab8b72c1a0736a5ddb4c470cf7b7b544ceb1
Merge: 006a495 9af5f67
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 1 13:15:40 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Dec 1 08:15:51 2017 -0500

    Merge topic 'fix-cmake-server-bad-buffering-test'
    
    9af5f672 test: Updated server test harness to try to cause fragmentation
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1508


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=375eca7881bceabf591a4fc278c198657aafbd5e
commit 375eca7881bceabf591a4fc278c198657aafbd5e
Author:     Adam Ciarciński <adam at viamedium.pl>
AuthorDate: Thu Nov 30 13:57:12 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 14:01:26 2017 -0500

    bootstrap: Check support for unordered_map from compiler mode
    
    Some versions of clang 5 (with libc++) have a problem with
    `unordered_map` under `-std=gnu++1z`:
    
        /usr/include/c++/__hash_table:1134:43: error: conflicting types for '__hash_table<_Tp, _Hash, _Equal, _Alloc>'
    
    Include `unordered_map` in our test source so that we reject this
    combination and fall back to an older C++ standard flag.
    
    Fixes: #17526

diff --git a/bootstrap b/bootstrap
index 47f7e76..6da87e7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1056,6 +1056,7 @@ TMPFILE=`cmake_tmp_file`
 echo '
 #include <iostream>
 #include <memory>
+#include <unordered_map>
 
 #if __cplusplus < 201103L
 #error "Compiler is not in a mode aware of C++11."

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3bcaa870078d875b65f17d82661a133f6d5cbdfc
commit 3bcaa870078d875b65f17d82661a133f6d5cbdfc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 30 11:26:25 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 13:43:43 2017 -0500

    cmUVHandlePtr: Add uv_process_ptr

diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index 78819a5..d7e38c3 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -172,6 +172,13 @@ uv_pipe_ptr::operator uv_stream_t*() const
 }
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
+int uv_process_ptr::spawn(uv_loop_t& loop, uv_process_options_t const& options,
+                          void* data)
+{
+  allocate(data);
+  return uv_spawn(&loop, *this, &options);
+}
+
 int uv_timer_ptr::init(uv_loop_t& loop, void* data)
 {
   allocate(data);
@@ -211,6 +218,8 @@ UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(stream)
 #ifdef CMAKE_BUILD_WITH_CMAKE
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(async)
 
+UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(process)
+
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(timer)
 
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(tty)
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index d3df69c..a6ce565 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -165,6 +165,14 @@ struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
   int init(uv_loop_t& loop, int ipc, void* data = nullptr);
 };
 
+struct uv_process_ptr : public uv_handle_ptr_<uv_process_t>
+{
+  CM_PERFECT_FWD_CTOR(uv_process_ptr, uv_handle_ptr_<uv_process_t>);
+
+  int spawn(uv_loop_t& loop, uv_process_options_t const& options,
+            void* data = nullptr);
+};
+
 struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
 {
   CM_PERFECT_FWD_CTOR(uv_timer_ptr, uv_handle_ptr_<uv_timer_t>);
@@ -200,6 +208,8 @@ UV_HANDLE_PTR_INSTANTIATE_EXTERN(signal)
 
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(pipe)
 
+UV_HANDLE_PTR_INSTANTIATE_EXTERN(process)
+
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(stream)
 
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(timer)
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index bb3493f..44def25 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -157,6 +157,7 @@ static bool testAllMoves()
     uv_stream_ptr _7;
     uv_timer_ptr _8;
     uv_tty_ptr _9;
+    uv_process_ptr _11;
     uv_pipe_ptr _12;
     uv_async_ptr _13;
     uv_signal_ptr _14;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dd700e9bfb2a498632845e76ce95dd38bb866a7b
commit dd700e9bfb2a498632845e76ce95dd38bb866a7b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 30 11:19:04 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 13:26:35 2017 -0500

    cmUVHandlePtr: Add uv_timer_ptr

diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index 8ba93e5..78819a5 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -172,6 +172,18 @@ uv_pipe_ptr::operator uv_stream_t*() const
 }
 
 #ifdef CMAKE_BUILD_WITH_CMAKE
+int uv_timer_ptr::init(uv_loop_t& loop, void* data)
+{
+  allocate(data);
+  return uv_timer_init(&loop, *this);
+}
+
+int uv_timer_ptr::start(uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
+{
+  assert(handle);
+  return uv_timer_start(*this, cb, timeout, repeat);
+}
+
 uv_tty_ptr::operator uv_stream_t*() const
 {
   return reinterpret_cast<uv_stream_t*>(handle.get());
@@ -199,6 +211,8 @@ UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(stream)
 #ifdef CMAKE_BUILD_WITH_CMAKE
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(async)
 
+UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(timer)
+
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(tty)
 #endif
 }
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index a251c5f..d3df69c 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -5,6 +5,7 @@
 
 #include <algorithm>
 #include <cstddef>
+#include <cstdint>
 #include <memory>
 #include <type_traits>
 
@@ -164,6 +165,15 @@ struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
   int init(uv_loop_t& loop, int ipc, void* data = nullptr);
 };
 
+struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
+{
+  CM_PERFECT_FWD_CTOR(uv_timer_ptr, uv_handle_ptr_<uv_timer_t>);
+
+  int init(uv_loop_t& loop, void* data = nullptr);
+
+  int start(uv_timer_cb cb, uint64_t timeout, uint64_t repeat);
+};
+
 struct uv_tty_ptr : public uv_handle_ptr_<uv_tty_t>
 {
   CM_PERFECT_FWD_CTOR(uv_tty_ptr, uv_handle_ptr_<uv_tty_t>);
@@ -192,6 +202,8 @@ UV_HANDLE_PTR_INSTANTIATE_EXTERN(pipe)
 
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(stream)
 
+UV_HANDLE_PTR_INSTANTIATE_EXTERN(timer)
+
 UV_HANDLE_PTR_INSTANTIATE_EXTERN(tty)
 
 #undef UV_HANDLE_PTR_INSTANTIATE_EXTERN
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index 7ecef39..bb3493f 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -155,6 +155,7 @@ static bool testAllMoves()
   struct allTypes
   {
     uv_stream_ptr _7;
+    uv_timer_ptr _8;
     uv_tty_ptr _9;
     uv_pipe_ptr _12;
     uv_async_ptr _13;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8112059ee7f38f0eb5cdcaba8185aec659abcbfc
commit 8112059ee7f38f0eb5cdcaba8185aec659abcbfc
Author:     Deniz Bahadir <dbahadir at benocs.com>
AuthorDate: Mon Nov 27 22:30:26 2017 +0100
Commit:     Deniz Bahadir <dbahadir at benocs.com>
CommitDate: Thu Nov 30 17:35:25 2017 +0100

    target_link_libraries: Simplify implementation and add comments.
    
    The implementation of `target_link_libraries` did grow over the years
    when new features where added. This commit cleans up the implementation
    and adds comments to better document its intention.
    
    The behavior of `target_link_libraries` itself is left untouched.

diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 65ab544..97bb0a2 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -25,16 +25,17 @@ const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] = {
 bool cmTargetLinkLibrariesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
 {
-  // must have one argument
+  // Must have at least one argument.
   if (args.empty()) {
     this->SetError("called with incorrect number of arguments");
     return false;
   }
-
+  // Alias targets cannot be on the LHS of this command.
   if (this->Makefile->IsAlias(args[0])) {
     this->SetError("can not be used on an ALIAS target.");
     return false;
   }
+
   // Lookup the target for which libraries are specified.
   this->Target =
     this->Makefile->GetCMakeInstance()->GetGlobalGenerator()->FindTarget(
@@ -78,8 +79,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
           break;
       }
     }
-
-    // now actually print the message
+    // Now actually print the message.
     switch (t) {
       case cmake::AUTHOR_WARNING:
         this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
@@ -94,6 +94,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
     return true;
   }
 
+  // OBJECT libraries are not allowed on the LHS of the command.
   if (this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
     std::ostringstream e;
     e << "Object library target \"" << args[0] << "\" "
@@ -103,6 +104,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
     return true;
   }
 
+  // Having a UTILITY library on the LHS is a bug.
   if (this->Target->GetType() == cmStateEnums::UTILITY) {
     std::ostringstream e;
     const char* modal = nullptr;
@@ -129,7 +131,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
     }
   }
 
-  // but we might not have any libs after variable expansion
+  // But we might not have any libs after variable expansion.
   if (args.size() < 2) {
     return true;
   }
@@ -142,8 +144,8 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
   // specification if the keyword is encountered as the first argument.
   this->CurrentProcessingState = ProcessingLinkLibraries;
 
-  // add libraries, note that there is an optional prefix
-  // of debug and optimized that can be used
+  // Add libraries, note that there is an optional prefix
+  // of debug and optimized that can be used.
   for (unsigned int i = 1; i < args.size(); ++i) {
     if (args[i] == "LINK_INTERFACE_LIBRARIES") {
       this->CurrentProcessingState = ProcessingPlainLinkInterface;
@@ -366,10 +368,13 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
     }
   }
 
-  // Handle normal case first.
+  // Handle normal case where the command was called with another keyword than
+  // INTERFACE / LINK_INTERFACE_LIBRARIES or none at all. (The "LINK_LIBRARIES"
+  // property of the target on the LHS shall be populated.)
   if (this->CurrentProcessingState != ProcessingKeywordLinkInterface &&
       this->CurrentProcessingState != ProcessingPlainLinkInterface) {
 
+    // Assure that the target on the LHS was created in the current directory.
     cmTarget* t =
       this->Makefile->FindLocalNonAliasTarget(this->Target->GetName());
     if (!t) {
@@ -408,72 +413,80 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
     }
 
     this->Target->AddLinkLibrary(*this->Makefile, lib, llt);
+  }
 
-    if (this->CurrentProcessingState == ProcessingLinkLibraries) {
-      this->Target->AppendProperty(
-        "INTERFACE_LINK_LIBRARIES",
-        this->Target->GetDebugGeneratorExpressions(lib, llt).c_str());
-      return true;
-    }
-    if (this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
-        this->CurrentProcessingState != ProcessingPlainPublicInterface) {
-      if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) {
-        std::string configLib =
-          this->Target->GetDebugGeneratorExpressions(lib, llt);
-        if (cmGeneratorExpression::IsValidTargetName(lib) ||
-            cmGeneratorExpression::Find(lib) != std::string::npos) {
-          configLib = "$<LINK_ONLY:" + configLib + ">";
-        }
-        this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
-                                     configLib.c_str());
+  // Handle (additional) case where the command was called with PRIVATE /
+  // LINK_PRIVATE and stop its processing. (The "INTERFACE_LINK_LIBRARIES"
+  // property of the target on the LHS shall only be populated if it is a
+  // STATIC library.)
+  if (this->CurrentProcessingState == ProcessingKeywordPrivateInterface ||
+      this->CurrentProcessingState == ProcessingPlainPrivateInterface) {
+    if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) {
+      std::string configLib =
+        this->Target->GetDebugGeneratorExpressions(lib, llt);
+      if (cmGeneratorExpression::IsValidTargetName(lib) ||
+          cmGeneratorExpression::Find(lib) != std::string::npos) {
+        configLib = "$<LINK_ONLY:" + configLib + ">";
       }
-      // Not a 'public' or 'interface' library. Do not add to interface
-      // property.
-      return true;
+      this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
+                                   configLib.c_str());
     }
+    return true;
   }
 
+  // Handle general case where the command was called with another keyword than
+  // PRIVATE / LINK_PRIVATE or none at all. (The "INTERFACE_LINK_LIBRARIES"
+  // property of the target on the LHS shall be populated.)
   this->Target->AppendProperty(
     "INTERFACE_LINK_LIBRARIES",
     this->Target->GetDebugGeneratorExpressions(lib, llt).c_str());
 
+  // Stop processing if called without any keyword.
+  if (this->CurrentProcessingState == ProcessingLinkLibraries) {
+    return true;
+  }
+  // Stop processing if policy CMP0022 is set to NEW.
   const cmPolicies::PolicyStatus policy22Status =
     this->Target->GetPolicyStatusCMP0022();
-
   if (policy22Status != cmPolicies::OLD &&
       policy22Status != cmPolicies::WARN) {
     return true;
   }
-
+  // Stop processing if called with an INTERFACE library on the LHS.
   if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
     return true;
   }
 
-  // Get the list of configurations considered to be DEBUG.
-  std::vector<std::string> debugConfigs =
-    this->Makefile->GetCMakeInstance()->GetDebugConfigs();
-  std::string prop;
-
-  // Include this library in the link interface for the target.
-  if (llt == DEBUG_LibraryType || llt == GENERAL_LibraryType) {
-    // Put in the DEBUG configuration interfaces.
-    for (std::string const& dc : debugConfigs) {
-      prop = "LINK_INTERFACE_LIBRARIES_";
-      prop += dc;
-      this->Target->AppendProperty(prop, lib.c_str());
+  // Handle (additional) backward-compatibility case where the command was
+  // called with PUBLIC / INTERFACE / LINK_PUBLIC / LINK_INTERFACE_LIBRARIES.
+  // (The policy CMP0022 is not set to NEW.)
+  {
+    // Get the list of configurations considered to be DEBUG.
+    std::vector<std::string> debugConfigs =
+      this->Makefile->GetCMakeInstance()->GetDebugConfigs();
+    std::string prop;
+
+    // Include this library in the link interface for the target.
+    if (llt == DEBUG_LibraryType || llt == GENERAL_LibraryType) {
+      // Put in the DEBUG configuration interfaces.
+      for (std::string const& dc : debugConfigs) {
+        prop = "LINK_INTERFACE_LIBRARIES_";
+        prop += dc;
+        this->Target->AppendProperty(prop, lib.c_str());
+      }
     }
-  }
-  if (llt == OPTIMIZED_LibraryType || llt == GENERAL_LibraryType) {
-    // Put in the non-DEBUG configuration interfaces.
-    this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
-
-    // Make sure the DEBUG configuration interfaces exist so that the
-    // general one will not be used as a fall-back.
-    for (std::string const& dc : debugConfigs) {
-      prop = "LINK_INTERFACE_LIBRARIES_";
-      prop += dc;
-      if (!this->Target->GetProperty(prop)) {
-        this->Target->SetProperty(prop, "");
+    if (llt == OPTIMIZED_LibraryType || llt == GENERAL_LibraryType) {
+      // Put in the non-DEBUG configuration interfaces.
+      this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib.c_str());
+
+      // Make sure the DEBUG configuration interfaces exist so that the
+      // general one will not be used as a fall-back.
+      for (std::string const& dc : debugConfigs) {
+        prop = "LINK_INTERFACE_LIBRARIES_";
+        prop += dc;
+        if (!this->Target->GetProperty(prop)) {
+          this->Target->SetProperty(prop, "");
+        }
       }
     }
   }
diff --git a/Source/cmTargetLinkLibrariesCommand.h b/Source/cmTargetLinkLibrariesCommand.h
index f41af49..a2f3ecd 100644
--- a/Source/cmTargetLinkLibrariesCommand.h
+++ b/Source/cmTargetLinkLibrariesCommand.h
@@ -20,6 +20,9 @@ class cmTarget;
  * cmTargetLinkLibrariesCommand is used to specify a list of libraries to link
  * into executable(s) or shared objects. The names of the libraries
  * should be those defined by the LIBRARY(library) command(s).
+ *
+ * Additionally, it allows to propagate usage-requirements (including link
+ * libraries) from one target into another.
  */
 class cmTargetLinkLibrariesCommand : public cmCommand
 {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32cfa7b324de799eefb2f7370fb54b700d1a87a5
commit 32cfa7b324de799eefb2f7370fb54b700d1a87a5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 30 11:11:54 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 11:19:31 2017 -0500

    cmUVHandlePtr: Move to CMakeLib to make it available everywhere

diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 88c63e1..5611e55 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -348,6 +348,8 @@ set(SRCS
   cmTestGenerator.cxx
   cmTestGenerator.h
   cmUuid.cxx
+  cmUVHandlePtr.cxx
+  cmUVHandlePtr.h
   cmVariableWatch.cxx
   cmVariableWatch.h
   cmVersion.cxx
@@ -1029,7 +1031,6 @@ list(APPEND _tools cmake)
 target_link_libraries(cmake CMakeLib)
 
 add_library(CMakeServerLib
-  cmUVHandlePtr.h cmUVHandlePtr.cxx
   cmConnection.h cmConnection.cxx
   cmFileMonitor.cxx cmFileMonitor.h
   cmPipeConnection.cxx cmPipeConnection.h
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index 214c7b2..8ba93e5 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -82,6 +82,7 @@ uv_handle_ptr_<T>::operator T*() const
   return this->handle.get();
 }
 
+#ifdef CMAKE_BUILD_WITH_CMAKE
 template <>
 struct uv_handle_deleter<uv_async_t>
 {
@@ -126,6 +127,7 @@ int uv_async_ptr::init(uv_loop_t& loop, uv_async_cb async_cb, void* data)
   allocate(data);
   return uv_async_init(&loop, handle.get(), async_cb);
 }
+#endif
 
 template <>
 struct uv_handle_deleter<uv_signal_t>
@@ -169,6 +171,7 @@ uv_pipe_ptr::operator uv_stream_t*() const
   return reinterpret_cast<uv_stream_t*>(handle.get());
 }
 
+#ifdef CMAKE_BUILD_WITH_CMAKE
 uv_tty_ptr::operator uv_stream_t*() const
 {
   return reinterpret_cast<uv_stream_t*>(handle.get());
@@ -179,6 +182,7 @@ int uv_tty_ptr::init(uv_loop_t& loop, int fd, int readable, void* data)
   allocate(data);
   return uv_tty_init(&loop, *this, fd, readable);
 }
+#endif
 
 template class uv_handle_ptr_base_<uv_handle_t>;
 
@@ -186,13 +190,15 @@ template class uv_handle_ptr_base_<uv_handle_t>;
   template class uv_handle_ptr_base_<uv_##NAME##_t>;                          \
   template class uv_handle_ptr_<uv_##NAME##_t>;
 
-UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(async)
-
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(signal)
 
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(pipe)
 
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(stream)
 
+#ifdef CMAKE_BUILD_WITH_CMAKE
+UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(async)
+
 UV_HANDLE_PTR_INSTANTIATE_EXPLICIT(tty)
+#endif
 }
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index d1a1df5..9f09185 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -12,6 +12,7 @@ set(CMakeLib_TESTS
   testXMLParser
   testXMLSafe
   testFindPackageCommand
+  testUVRAII
   )
 
 set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
@@ -31,6 +32,9 @@ create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
 add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS})
 target_link_libraries(CMakeLibTests CMakeLib)
 
+set_property(TARGET CMakeLibTests PROPERTY C_CLANG_TIDY "")
+set_property(TARGET CMakeLibTests PROPERTY CXX_CLANG_TIDY "")
+
 add_executable(testEncoding testEncoding.cxx)
 target_link_libraries(testEncoding cmsys)
 
diff --git a/Tests/CMakeServerLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
similarity index 100%
rename from Tests/CMakeServerLib/testUVRAII.cxx
rename to Tests/CMakeLib/testUVRAII.cxx
diff --git a/Tests/CMakeServerLib/CMakeLists.txt b/Tests/CMakeServerLib/CMakeLists.txt
index f1ca2a4..5e1ad0c 100644
--- a/Tests/CMakeServerLib/CMakeLists.txt
+++ b/Tests/CMakeServerLib/CMakeLists.txt
@@ -6,7 +6,6 @@ include_directories(
 
 set(CMakeServerLib_TESTS
   testServerBuffering
-  testUVRAII
   )
 
 create_test_sourcelist(CMakeLib_TEST_SRCS CMakeServerLibTests.cxx ${CMakeServerLib_TESTS})
diff --git a/bootstrap b/bootstrap
index ab087e9..45f9c2d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -418,6 +418,7 @@ CMAKE_CXX_SOURCES="\
   cmTryRunCommand \
   cmUnexpectedCommand \
   cmUnsetCommand \
+  cmUVHandlePtr \
   cmVersion \
   cmWhileCommand \
   cmWorkingDirectory \

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9af5f6727716ab8b9b61815ec67e1c4ffe1213b6
commit 9af5f6727716ab8b9b61815ec67e1c4ffe1213b6
Author:     Justin Berger <j.david.berger at gmail.com>
AuthorDate: Mon Nov 20 08:31:56 2017 -0700
Commit:     Justin Berger <jberger at melco.com>
CommitDate: Wed Nov 29 12:35:42 2017 -0700

    test: Updated server test harness to try to cause fragmentation

diff --git a/Tests/Server/cmakelib.py b/Tests/Server/cmakelib.py
index 39e3618..6e8761a 100644
--- a/Tests/Server/cmakelib.py
+++ b/Tests/Server/cmakelib.py
@@ -100,6 +100,14 @@ def waitForRawMessage(cmakeCommand):
           return jsonPayload
       stdoutdata = stdoutdata[(end+len(']== "CMake Server" ==]')):]
 
+# Python2 has no problem writing the output of encodes directly,
+# but Python3 returns only 'int's for encode and so must be turned
+# into bytes. We use the existence of 'to_bytes' on an int to
+# determine which behavior is appropriate. It might be more clear
+# to do this in the code which uses the flag, but introducing
+# this lookup cost at every byte sent isn't ideal.
+has_to_bytes = "to_bytes" in dir(10)
+
 def writeRawData(cmakeCommand, content):
   writeRawData.counter += 1
   payload = """
@@ -116,7 +124,25 @@ def writeRawData(cmakeCommand, content):
   if print_communication:
     printClient(content, "(Use \\r\\n:", rn, ")")
 
-  cmakeCommand.write(payload.encode('utf-8'))
+  # To stress test how cmake deals with fragmentation in the
+  # communication channel, we send only one byte at a time.
+  # Certain communication methods / platforms might still buffer
+  # it all into one message since its so close together, but in
+  # general this will catch places where we assume full buffers
+  # come in all at once.
+  encoded_payload = payload.encode('utf-8')
+
+  # Python version 3+ can't write ints directly; but 'to_bytes'
+  # for int was only added in python 3.2. If this is a 3+ version
+  # of python without that conversion function; just write the whole
+  # thing out at once.
+  if sys.version_info[0] > 2 and not has_to_bytes:
+    cmakeCommand.write(encoded_payload)
+  else:
+    for c in encoded_payload:
+      if has_to_bytes:
+        c = c.to_bytes(1, byteorder='big')
+      cmakeCommand.write(c)
 
 writeRawData.counter = 0
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0e2f1415e680337f4b70b19e319efeba0eb6f12
commit b0e2f1415e680337f4b70b19e319efeba0eb6f12
Author:     Deniz Bahadir <dbahadir at benocs.com>
AuthorDate: Mon Nov 27 22:11:11 2017 +0100
Commit:     Deniz Bahadir <dbahadir at benocs.com>
CommitDate: Wed Nov 29 17:01:47 2017 +0100

    target_link_libraries: Slightly fix some error-messages.
    
    Some error-messages are slightly adjusted to better tell what
    invocation would be correct instead. Tests are adjusted accordingly.

diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index ec060cd..65ab544 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -160,8 +160,9 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
           this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
           this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
         this->Makefile->IssueMessage(
-          cmake::FATAL_ERROR, "The INTERFACE option must appear as the second "
-                              "argument, just after the target name.");
+          cmake::FATAL_ERROR,
+          "The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
+          "argument, just after the target name.");
         return true;
       }
       this->CurrentProcessingState = ProcessingKeywordLinkInterface;
@@ -183,7 +184,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
           this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
         this->Makefile->IssueMessage(
           cmake::FATAL_ERROR,
-          "The PUBLIC or PRIVATE option must appear as the second "
+          "The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
           "argument, just after the target name.");
         return true;
       }
@@ -206,7 +207,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
           this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
         this->Makefile->IssueMessage(
           cmake::FATAL_ERROR,
-          "The PUBLIC or PRIVATE option must appear as the second "
+          "The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
           "argument, just after the target name.");
         return true;
       }
@@ -349,12 +350,11 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
       // form must be the plain form.
       const char* existingSig =
         (sig == cmTarget::KeywordTLLSignature ? "plain" : "keyword");
-      e << "The " << existingSig << " signature for target_link_libraries "
-                                    "has already been used with the target \""
-        << this->Target->GetName() << "\".  All uses of "
-                                      "target_link_libraries with a target "
-        << modal << " be either "
-                    "all-keyword or all-plain.\n";
+      e << "The " << existingSig << " signature for target_link_libraries has "
+                                    "already been used with the target \""
+        << this->Target->GetName()
+        << "\".  All uses of target_link_libraries with a target " << modal
+        << " be either all-keyword or all-plain.\n";
       this->Target->GetTllSignatureTraces(e,
                                           sig == cmTarget::KeywordTLLSignature
                                             ? cmTarget::PlainTLLSignature
@@ -401,9 +401,9 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
       std::ostringstream e;
       e << "Target \"" << lib << "\" of type "
         << cmState::GetTargetTypeName(tgt->GetType())
-        << " may not be linked into another target.  "
-        << "One may link only to STATIC or SHARED libraries, or "
-        << "to executables with the ENABLE_EXPORTS property set.";
+        << " may not be linked into another target.  One may link only to "
+           "INTERFACE, STATIC or SHARED libraries, or to executables with the "
+           "ENABLE_EXPORTS property set.";
       this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     }
 
diff --git a/Tests/RunCMake/ObjectLibrary/LinkObjRHS1-stderr.txt b/Tests/RunCMake/ObjectLibrary/LinkObjRHS1-stderr.txt
index 8809f89..d5ee4f9 100644
--- a/Tests/RunCMake/ObjectLibrary/LinkObjRHS1-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/LinkObjRHS1-stderr.txt
@@ -1,6 +1,6 @@
 CMake Error at LinkObjRHS1.cmake:3 \(target_link_libraries\):
   Target "AnObjLib" of type OBJECT_LIBRARY may not be linked into another
-  target.  One may link only to STATIC or SHARED libraries, or to executables
-  with the ENABLE_EXPORTS property set.
+  target.  One may link only to INTERFACE, STATIC or SHARED libraries, or to
+  executables with the ENABLE_EXPORTS property set.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt
index a0c66db..c6237f4 100644
--- a/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt
@@ -1,5 +1,5 @@
 CMake Error at MixedSignature.cmake:6 \(target_link_libraries\):
-  The PUBLIC or PRIVATE option must appear as the second argument, just after
-  the target name.
+  The INTERFACE, PUBLIC or PRIVATE option must appear as the second argument,
+  just after the target name.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=85457b63c859f238ef324757f1042cc846cedbc7
commit 85457b63c859f238ef324757f1042cc846cedbc7
Author:     Deniz Bahadir <dbahadir at benocs.com>
AuthorDate: Mon Nov 27 22:02:43 2017 +0100
Commit:     Deniz Bahadir <dbahadir at benocs.com>
CommitDate: Wed Nov 29 17:00:56 2017 +0100

    target_link_libraries: Return earlier on some error.

diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 37bcb70..ec060cd 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -388,27 +388,27 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
         << this->Target->GetName()
         << "\" which is not built in this directory.";
       this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
-    } else {
+      return false;
+    }
 
-      cmTarget* tgt = this->Makefile->GetGlobalGenerator()->FindTarget(lib);
-
-      if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) &&
-          (tgt->GetType() != cmStateEnums::SHARED_LIBRARY) &&
-          (tgt->GetType() != cmStateEnums::UNKNOWN_LIBRARY) &&
-          (tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) &&
-          !tgt->IsExecutableWithExports()) {
-        std::ostringstream e;
-        e << "Target \"" << lib << "\" of type "
-          << cmState::GetTargetTypeName(tgt->GetType())
-          << " may not be linked into another target.  "
-          << "One may link only to STATIC or SHARED libraries, or "
-          << "to executables with the ENABLE_EXPORTS property set.";
-        this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
-      }
+    cmTarget* tgt = this->Makefile->GetGlobalGenerator()->FindTarget(lib);
 
-      this->Target->AddLinkLibrary(*this->Makefile, lib, llt);
+    if (tgt && (tgt->GetType() != cmStateEnums::STATIC_LIBRARY) &&
+        (tgt->GetType() != cmStateEnums::SHARED_LIBRARY) &&
+        (tgt->GetType() != cmStateEnums::UNKNOWN_LIBRARY) &&
+        (tgt->GetType() != cmStateEnums::INTERFACE_LIBRARY) &&
+        !tgt->IsExecutableWithExports()) {
+      std::ostringstream e;
+      e << "Target \"" << lib << "\" of type "
+        << cmState::GetTargetTypeName(tgt->GetType())
+        << " may not be linked into another target.  "
+        << "One may link only to STATIC or SHARED libraries, or "
+        << "to executables with the ENABLE_EXPORTS property set.";
+      this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
     }
 
+    this->Target->AddLinkLibrary(*this->Makefile, lib, llt);
+
     if (this->CurrentProcessingState == ProcessingLinkLibraries) {
       this->Target->AppendProperty(
         "INTERFACE_LINK_LIBRARIES",

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

Summary of changes:
 Source/CMakeLists.txt                              |    3 +-
 Source/cmTargetLinkLibrariesCommand.cxx            |  175 +++++++++++---------
 Source/cmTargetLinkLibrariesCommand.h              |    3 +
 Source/cmUVHandlePtr.cxx                           |   33 +++-
 Source/cmUVHandlePtr.h                             |   22 +++
 Tests/CMakeLib/CMakeLists.txt                      |    4 +
 Tests/{CMakeServerLib => CMakeLib}/testUVRAII.cxx  |    2 +
 Tests/CMakeServerLib/CMakeLists.txt                |    1 -
 .../RunCMake/ObjectLibrary/LinkObjRHS1-stderr.txt  |    4 +-
 .../MixedSignature-stderr.txt                      |    4 +-
 Tests/Server/cmakelib.py                           |   28 +++-
 bootstrap                                          |    2 +
 12 files changed, 191 insertions(+), 90 deletions(-)
 rename Tests/{CMakeServerLib => CMakeLib}/testUVRAII.cxx (98%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list