[Cmake-commits] CMake branch, master, updated. v3.10.0-478-g4d0bcc9

Kitware Robot kwrobot at kitware.com
Fri Dec 1 08:05: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  4d0bcc94c4b965dc08f826d2242248fa3db885b7 (commit)
       via  340fae777a45c318cf71cd0fbd51bf30194761f2 (commit)
       via  b2f612a0fabfb87e79b60f440c05a2cecde424f0 (commit)
       via  d094b6796a3d9ee91a00f9541416e5d1e9304da8 (commit)
       via  5fa414594eb4c1ca9e7041eb443d503ff495d90d (commit)
       via  a3e029effd84dc185a9cc12e9b4efd48c70dffa6 (commit)
      from  6287365ab090078be306b3199f2e42d8e423311f (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=4d0bcc94c4b965dc08f826d2242248fa3db885b7
commit 4d0bcc94c4b965dc08f826d2242248fa3db885b7
Merge: 340fae7 b2f612a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 1 13:04:17 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Dec 1 08:04:21 2017 -0500

    Merge topic 'simplify-fallthrough'
    
    b2f612a0 Simplify CM_FALLTHROUGH implementation
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1540


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=340fae777a45c318cf71cd0fbd51bf30194761f2
commit 340fae777a45c318cf71cd0fbd51bf30194761f2
Merge: 6287365 d094b67
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Dec 1 13:03:46 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Dec 1 08:03:53 2017 -0500

    Merge topic 'update-kwsys'
    
    d094b679 Merge branch 'upstream-KWSys' into update-kwsys
    5fa41459 KWSys 2017-11-30 (fa1ab7b8)
    a3e029ef cmStandardLexer.h: Do not include a C++ header
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1539


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b2f612a0fabfb87e79b60f440c05a2cecde424f0
commit b2f612a0fabfb87e79b60f440c05a2cecde424f0
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 30 08:58:01 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 09:50:39 2017 -0500

    Simplify CM_FALLTHROUGH implementation
    
    Use the macro now provided by KWSys instead of using `try_compile`
    checks.  It will no longer consider the `__attribute__((fallthrough))`
    variant, but compilers that don't have one of the modern attributes
    shouldn't warn about not using one anyway.

diff --git a/Source/Checks/cm_cxx_attribute_fallthrough.cxx b/Source/Checks/cm_cxx_attribute_fallthrough.cxx
deleted file mode 100644
index 50605b7..0000000
--- a/Source/Checks/cm_cxx_attribute_fallthrough.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-int main(int argc, char* [])
-{
-  int i = 3;
-  switch (argc) {
-    case 1:
-      i = 0;
-      __attribute__((fallthrough));
-    default:
-      return i;
-  }
-}
diff --git a/Source/Checks/cm_cxx_fallthrough.cxx b/Source/Checks/cm_cxx_fallthrough.cxx
deleted file mode 100644
index 2825bed..0000000
--- a/Source/Checks/cm_cxx_fallthrough.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-int main(int argc, char* [])
-{
-  int i = 3;
-  switch (argc) {
-    case 1:
-      i = 0;
-      [[fallthrough]];
-    default:
-      return i;
-  }
-}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index a30a5e6..2704c40 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -41,13 +41,6 @@ function(cm_check_cxx_feature name)
   endif()
 endfunction()
 
-cm_check_cxx_feature(fallthrough)
-if(NOT CMake_HAVE_CXX_FALLTHROUGH)
-  cm_check_cxx_feature(gnu_fallthrough)
-  if(NOT CMake_HAVE_CXX_GNU_FALLTHROUGH)
-    cm_check_cxx_feature(attribute_fallthrough)
-  endif()
-endif()
 cm_check_cxx_feature(make_unique)
 if(CMake_HAVE_CXX_MAKE_UNIQUE)
   set(CMake_HAVE_CXX_UNIQUE_PTR 1)
diff --git a/Source/Checks/cm_cxx_gnu_fallthrough.cxx b/Source/Checks/cm_cxx_gnu_fallthrough.cxx
deleted file mode 100644
index ebc15f4..0000000
--- a/Source/Checks/cm_cxx_gnu_fallthrough.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-int main(int argc, char* [])
-{
-  int i = 3;
-  switch (argc) {
-    case 1:
-      i = 0;
-      [[gnu::fallthrough]];
-    default:
-      return i;
-  }
-}
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 9a78aca..c80439b 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -19,22 +19,11 @@
 #cmakedefine HAVE_UNSETENV
 #cmakedefine CMAKE_USE_ELF_PARSER
 #cmakedefine CMAKE_USE_MACH_PARSER
-#cmakedefine CMake_HAVE_CXX_FALLTHROUGH
-#cmakedefine CMake_HAVE_CXX_GNU_FALLTHROUGH
-#cmakedefine CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH
 #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
 #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
 
-#if defined(CMake_HAVE_CXX_FALLTHROUGH)
-#define CM_FALLTHROUGH [[fallthrough]]
-#elif defined(CMake_HAVE_CXX_GNU_FALLTHROUGH)
-#define CM_FALLTHROUGH [[gnu::fallthrough]]
-#elif defined(CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH)
-#define CM_FALLTHROUGH __attribute__((fallthrough))
-#else
-#define CM_FALLTHROUGH
-#endif
+#define CM_FALLTHROUGH cmsys_FALLTHROUGH
 
 #define CM_DISABLE_COPY(Class)                                                \
   Class(Class const&) = delete;                                               \

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d094b6796a3d9ee91a00f9541416e5d1e9304da8
commit d094b6796a3d9ee91a00f9541416e5d1e9304da8
Merge: a3e029e 5fa4145
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 30 08:52:45 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 08:52:45 2017 -0500

    Merge branch 'upstream-KWSys' into update-kwsys
    
    * upstream-KWSys:
      KWSys 2017-11-30 (fa1ab7b8)

diff --cc Source/kwsys/testConfigure.cxx
index 0000000,916dcc1..916dcc1
mode 000000,100644..100644
--- a/Source/kwsys/testConfigure.cxx
+++ b/Source/kwsys/testConfigure.cxx

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=5fa414594eb4c1ca9e7041eb443d503ff495d90d
commit 5fa414594eb4c1ca9e7041eb443d503ff495d90d
Author:     KWSys Upstream <kwrobot at kitware.com>
AuthorDate: Thu Nov 30 08:15:37 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 08:52:44 2017 -0500

    KWSys 2017-11-30 (fa1ab7b8)
    
    Code extracted from:
    
        https://gitlab.kitware.com/utils/kwsys.git
    
    at commit fa1ab7b8d790498359ab1b1bff522a7401a918fc (master).
    
    Upstream Shortlog
    -----------------
    
    Brad King (1):
          1b09cf0d Configure: Add KWSYS_FALLTHROUGH macro for C++ code

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 51f4088..64b6484 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1033,6 +1033,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
         )
     ENDIF()
     SET(KWSYS_CXX_TESTS ${KWSYS_CXX_TESTS}
+      testConfigure
       testSystemTools
       testCommandLineArguments
       testCommandLineArguments1
diff --git a/Configure.hxx.in b/Configure.hxx.in
index 1c07a4e..1e67874 100644
--- a/Configure.hxx.in
+++ b/Configure.hxx.in
@@ -12,6 +12,31 @@
 #define @KWSYS_NAMESPACE at _CXX_HAS_EXT_STDIO_FILEBUF_H                         \
   @KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H@
 
+#if defined(__SUNPRO_CC) && __SUNPRO_CC > 0x5130 && defined(__has_attribute)
+#define @KWSYS_NAMESPACE at __has_cpp_attribute(x) __has_attribute(x)
+#elif defined(__has_cpp_attribute)
+#define @KWSYS_NAMESPACE at __has_cpp_attribute(x) __has_cpp_attribute(x)
+#else
+#define @KWSYS_NAMESPACE at __has_cpp_attribute(x) 0
+#endif
+
+#ifndef @KWSYS_NAMESPACE at _FALLTHROUGH
+#if __cplusplus >= 201703L && @KWSYS_NAMESPACE at __has_cpp_attribute(fallthrough)
+#define @KWSYS_NAMESPACE at _FALLTHROUGH [[fallthrough]]
+#elif __cplusplus >= 201103L &&                                               \
+  @KWSYS_NAMESPACE at __has_cpp_attribute(gnu::fallthrough)
+#define @KWSYS_NAMESPACE at _FALLTHROUGH [[gnu::fallthrough]]
+#elif __cplusplus >= 201103L &&                                               \
+  @KWSYS_NAMESPACE at __has_cpp_attribute(clang::fallthrough)
+#define @KWSYS_NAMESPACE at _FALLTHROUGH [[clang::fallthrough]]
+#endif
+#endif
+#ifndef @KWSYS_NAMESPACE at _FALLTHROUGH
+#define @KWSYS_NAMESPACE at _FALLTHROUGH static_cast<void>(0)
+#endif
+
+#undef @KWSYS_NAMESPACE at __has_cpp_attribute
+
 /* If building a C++ file in kwsys itself, give the source file
    access to the macros without a configured namespace.  */
 #if defined(KWSYS_NAMESPACE)
@@ -22,6 +47,7 @@
 #define KWSYS_STL_HAS_WSTRING @KWSYS_NAMESPACE at _STL_HAS_WSTRING
 #define KWSYS_CXX_HAS_EXT_STDIO_FILEBUF_H                                     \
   @KWSYS_NAMESPACE at _CXX_HAS_EXT_STDIO_FILEBUF_H
+#define KWSYS_FALLTHROUGH @KWSYS_NAMESPACE at _FALLTHROUGH
 #endif
 
 #endif
diff --git a/testConfigure.cxx b/testConfigure.cxx
new file mode 100644
index 0000000..916dcc1
--- /dev/null
+++ b/testConfigure.cxx
@@ -0,0 +1,30 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+file Copyright.txt or https://cmake.org/licensing#kwsys for details.  */
+#include "kwsysPrivate.h"
+#include KWSYS_HEADER(Configure.hxx)
+
+// Work-around CMake dependency scanning limitation.  This must
+// duplicate the above list of headers.
+#if 0
+#include "Configure.hxx.in"
+#endif
+
+static bool testFallthrough(int n)
+{
+  int r = 0;
+  switch (n) {
+    case 1:
+      ++r;
+      KWSYS_FALLTHROUGH;
+    default:
+      ++r;
+  }
+  return r == 2;
+}
+
+int testConfigure(int, char* [])
+{
+  bool res = true;
+  res = testFallthrough(1) && res;
+  return res ? 0 : 1;
+}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3e029effd84dc185a9cc12e9b4efd48c70dffa6
commit a3e029effd84dc185a9cc12e9b4efd48c70dffa6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Nov 30 08:46:06 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Nov 30 08:46:06 2017 -0500

    cmStandardLexer.h: Do not include a C++ header
    
    This header is meant for inclusion in lexer `.c` files.

diff --git a/Source/cmStandardLexer.h b/Source/cmStandardLexer.h
index c9f42e4..b212c7e 100644
--- a/Source/cmStandardLexer.h
+++ b/Source/cmStandardLexer.h
@@ -3,7 +3,7 @@
 #ifndef cmStandardLexer_h
 #define cmStandardLexer_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmsys/Configure.h" // IWYU pragma: keep
 
 /* Disable some warnings.  */
 #if defined(_MSC_VER)

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

Summary of changes:
 Source/Checks/cm_cxx_attribute_fallthrough.cxx |   11 ---------
 Source/Checks/cm_cxx_fallthrough.cxx           |   11 ---------
 Source/Checks/cm_cxx_features.cmake            |    7 ------
 Source/Checks/cm_cxx_gnu_fallthrough.cxx       |   11 ---------
 Source/cmConfigure.cmake.h.in                  |   13 +---------
 Source/cmStandardLexer.h                       |    2 +-
 Source/kwsys/CMakeLists.txt                    |    1 +
 Source/kwsys/Configure.hxx.in                  |   26 ++++++++++++++++++++
 Source/kwsys/testConfigure.cxx                 |   30 ++++++++++++++++++++++++
 9 files changed, 59 insertions(+), 53 deletions(-)
 delete mode 100644 Source/Checks/cm_cxx_attribute_fallthrough.cxx
 delete mode 100644 Source/Checks/cm_cxx_fallthrough.cxx
 delete mode 100644 Source/Checks/cm_cxx_gnu_fallthrough.cxx
 create mode 100644 Source/kwsys/testConfigure.cxx


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list