[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3906-gea103fe
Rolf Eike Beer
eike at sf-mail.de
Thu Aug 15 17:20:28 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 ea103fe1b36a3ba3b2d41420e59270c118b1a971 (commit)
via 64405bbaa91e766a3b69c24989d78ea00a92cc2c (commit)
via 262716bd82b63985299cd8bf357cdf4d3add0ba5 (commit)
via 74ae500cd1a8b8d6251fe547382d09c1dc63ab06 (commit)
from b80865fbcde1d85542620444c22b8a66605cbbdf (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=ea103fe1b36a3ba3b2d41420e59270c118b1a971
commit ea103fe1b36a3ba3b2d41420e59270c118b1a971
Merge: b80865f 64405bb
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Aug 15 17:20:26 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Aug 15 17:20:26 2013 -0400
Merge topic 'cxx11' into next
64405bb CXXFeatures: allow test results to differ dependin on headers
262716b CXXFeatures: avoid checking nullptr_t in nullptr test
74ae500 CXXFeatures: include <initializer_list> in it's testcase
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=64405bbaa91e766a3b69c24989d78ea00a92cc2c
commit 64405bbaa91e766a3b69c24989d78ea00a92cc2c
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Aug 15 23:03:35 2013 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu Aug 15 23:03:35 2013 +0200
CXXFeatures: allow test results to differ dependin on headers
Some features depend on support from the C++ library, not only the compiler.
diff --git a/Tests/Module/FindCXXFeatures/CMakeLists.txt b/Tests/Module/FindCXXFeatures/CMakeLists.txt
index 7f03457..792721c 100644
--- a/Tests/Module/FindCXXFeatures/CMakeLists.txt
+++ b/Tests/Module/FindCXXFeatures/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
project(FindCXXFeatures CXX)
+# all detectable features
set(_all_cxx_features
auto
class_override_final
@@ -21,6 +22,21 @@ set(_all_cxx_features
variadic_templates
)
+# a feature that even a non-supporting compiler can offer
+# when the correct headers are present
+set(_header_on_features
+ cstdint_header
+)
+
+# features that need the proper headers in place, i.e. a
+# supporting compiler with older headers will fail
+# nullptr test intentionally does not test for nullptr_t so it
+# is independent of any headers
+set(_header_off_features
+ ${_header_on_features}
+ initializer_list
+)
+
unset(_expected_features)
unset(_expected_cxx11_flag)
unset(_compiler_unknown_features)
@@ -255,12 +271,22 @@ foreach (flag IN LISTS _all_cxx_features)
add_definitions("-D${_full_flag}")
message(STATUS "Compiler C++ support flag ${_full_flag} set")
if (_flag_index EQUAL -1 AND NOT _compiler_unknown_features)
- message(WARNING "C++ feature '${flag}' was detected, but not expected")
- set(_compiler_unknown_flag)
+ list(FIND _header_on_features "${flag}" _flag_index)
+ if (_flag_index EQUAL -1)
+ message(WARNING "C++ feature '${flag}' was detected, but not expected")
+ set(_compiler_unknown_flag)
+ else ()
+ message(STATUS "C++ feature '${flag}' was detected because of additional header present")
+ endif ()
endif ()
else ()
if (NOT _flag_index EQUAL -1)
- message(SEND_ERROR "Expected C++ feature '${flag}' not detected")
+ list(FIND _header_off_features "${flag}" _flag_index)
+ if (_flag_index EQUAL -1)
+ message(SEND_ERROR "Expected C++ feature '${flag}' not detected")
+ else ()
+ message(WARNING "Expected C++ feature '${flag}' not detected, support probably missing in library")
+ endif ()
set(_send_logs TRUE)
endif ()
endif ()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=262716bd82b63985299cd8bf357cdf4d3add0ba5
commit 262716bd82b63985299cd8bf357cdf4d3add0ba5
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Aug 15 22:32:00 2013 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu Aug 15 22:32:00 2013 +0200
CXXFeatures: avoid checking nullptr_t in nullptr test
std::nullptr_t is in <cstddef>, which means the test will fail with a
supporting compiler but old headers. nullptr itself should work without any
headers.
diff --git a/Modules/FindCXXFeatures/cxx11-nullptr.cxx b/Modules/FindCXXFeatures/cxx11-nullptr.cxx
index e87ca65..317f471 100644
--- a/Modules/FindCXXFeatures/cxx11-nullptr.cxx
+++ b/Modules/FindCXXFeatures/cxx11-nullptr.cxx
@@ -1,9 +1,19 @@
-#include <cstddef>
+int func(int)
+{
+ return 1;
+}
+
+int func(void *)
+{
+ return 0;
+}
int main(void)
{
void *v = nullptr;
- std::nullptr_t n = nullptr;
- return v ? 1 : 0;
+ if (v)
+ return 1;
+
+ return func(nullptr);
}
diff --git a/Tests/Module/FindCXXFeatures/cxxfeatures.cxx b/Tests/Module/FindCXXFeatures/cxxfeatures.cxx
index 865012e..5a3c72f 100644
--- a/Tests/Module/FindCXXFeatures/cxxfeatures.cxx
+++ b/Tests/Module/FindCXXFeatures/cxxfeatures.cxx
@@ -19,7 +19,7 @@ struct thing {
int main()
{
#if defined (CXXFEATURES_NULLPTR_FOUND)
- nullptr_t *nix = nullptr;
+ void *nix = nullptr;
#else /* CXXFEATURES_NULLPTR_FOUND */
void *nix = 0;
#endif /* CXXFEATURES_NULLPTR_FOUND */
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=74ae500cd1a8b8d6251fe547382d09c1dc63ab06
commit 74ae500cd1a8b8d6251fe547382d09c1dc63ab06
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Thu Aug 15 21:54:30 2013 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Thu Aug 15 21:54:30 2013 +0200
CXXFeatures: include <initializer_list> in it's testcase
diff --git a/Modules/FindCXXFeatures/cxx11-initializer_list.cxx b/Modules/FindCXXFeatures/cxx11-initializer_list.cxx
index 35e6c38..a23e962 100644
--- a/Modules/FindCXXFeatures/cxx11-initializer_list.cxx
+++ b/Modules/FindCXXFeatures/cxx11-initializer_list.cxx
@@ -1,3 +1,4 @@
+#include <initializer_list>
#include <vector>
class seq {
-----------------------------------------------------------------------
Summary of changes:
Modules/FindCXXFeatures/cxx11-initializer_list.cxx | 1 +
Modules/FindCXXFeatures/cxx11-nullptr.cxx | 16 ++++++++--
Tests/Module/FindCXXFeatures/CMakeLists.txt | 32 ++++++++++++++++++--
Tests/Module/FindCXXFeatures/cxxfeatures.cxx | 2 +-
4 files changed, 44 insertions(+), 7 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list