[Cmake-commits] CMake branch, next, updated. v3.1.0-rc2-814-gc41f18c

Stephen Kelly steveire at gmail.com
Mon Nov 24 15:51:06 EST 2014


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  c41f18c153db0ac14804982a9a61f00134903f25 (commit)
       via  7b1cdd862f9a01e4a233a618f127899bed6b7ce3 (commit)
      from  0493da401da8fc6b750a30ff98501b6d48a9ac37 (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=c41f18c153db0ac14804982a9a61f00134903f25
commit c41f18c153db0ac14804982a9a61f00134903f25
Merge: 0493da4 7b1cdd8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 24 15:51:05 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Nov 24 15:51:05 2014 -0500

    Merge topic 'C-features-Wundef' into next
    
    7b1cdd86 WCDH: Make the header -Wundef safe for the C language.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b1cdd862f9a01e4a233a618f127899bed6b7ce3
commit 7b1cdd862f9a01e4a233a618f127899bed6b7ce3
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Nov 24 21:47:48 2014 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Nov 24 21:47:48 2014 +0100

    WCDH: Make the header -Wundef safe for the C language.
    
    The __STDC_VERSION__ macro may be defined or not depending on the
    implementation dialect of C.  Test that it is defined before testing
    its value.
    
    The CXX tests do not need such a change because they define __cplusplus
    in all dialects.

diff --git a/Modules/Compiler/Clang-C-FeatureTests.cmake b/Modules/Compiler/Clang-C-FeatureTests.cmake
index 4a72e87..2d8673d 100644
--- a/Modules/Compiler/Clang-C-FeatureTests.cmake
+++ b/Modules/Compiler/Clang-C-FeatureTests.cmake
@@ -1,9 +1,9 @@
 
 set(_cmake_oldestSupported "((__clang_major__ * 100) + __clang_minor__) >= 304")
 
-set(Clang_C11 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 201112L")
+set(Clang_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
 set(_cmake_feature_test_c_static_assert "${Clang_C11}")
-set(Clang_C99 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 199901L")
+set(Clang_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
 set(_cmake_feature_test_c_restrict "${Clang_C99}")
 set(_cmake_feature_test_c_variadic_macros "${Clang_C99}")
 
diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake
index dc1695c..dfaeebf 100644
--- a/Modules/Compiler/GNU-C-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-C-FeatureTests.cmake
@@ -1,10 +1,10 @@
 
 set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407")
 
-set(GNU46_C11 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 201112L")
+set(GNU46_C11 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L")
 set(_cmake_feature_test_c_static_assert "${GNU46_C11}")
 # Since 4.4 at least:
-set(GNU44_C99 "${_cmake_oldestSupported} && __STDC_VERSION__ >= 199901L")
+set(GNU44_C99 "${_cmake_oldestSupported} && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
 set(_cmake_feature_test_c_restrict "${GNU44_C99}")
 set(_cmake_feature_test_c_variadic_macros "${GNU44_C99}")
 
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 645cc65..7bf9f28 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -63,6 +63,13 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU
   list(APPEND false_defs EXPECTED_COMPILER_CXX_VARIADIC_TEMPLATES)
 endif()
 
+if (CMAKE_C_COMPILER_ID STREQUAL GNU
+    OR CMAKE_C_COMPILER_ID STREQUAL Clang)
+  add_executable(C_undefined c_undefined.c)
+  set_property(TARGET C_undefined PROPERTY CXX_STANDARD 90)
+  target_compile_options(C_undefined PRIVATE -Werror=undef)
+endif()
+
 add_executable(WriteCompilerDetectionHeader main.cpp)
 set_property(TARGET WriteCompilerDetectionHeader PROPERTY CXX_STANDARD 98)
 set_defines(WriteCompilerDetectionHeader "${true_defs}" "${false_defs}")

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

Summary of changes:
 Modules/Compiler/Clang-C-FeatureTests.cmake              |    4 ++--
 Modules/Compiler/GNU-C-FeatureTests.cmake                |    4 ++--
 Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt |    7 +++++++
 3 files changed, 11 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list