[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3645-g3a9db61
Rolf Eike Beer
eike at sf-mail.de
Sun Aug 4 06:08:55 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 3a9db6178253b149b7723076914c1606d2ed7e7e (commit)
via a85c5000abb79e176173cd70b843492dd231a978 (commit)
from dd1ce587c595a6fa077c2354b0abd74de5667b0b (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=3a9db6178253b149b7723076914c1606d2ed7e7e
commit 3a9db6178253b149b7723076914c1606d2ed7e7e
Merge: dd1ce58 a85c500
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sun Aug 4 06:08:52 2013 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Aug 4 06:08:52 2013 -0400
Merge topic 'cxx11' into next
a85c500 CXXFeatures: add support for XL
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a85c5000abb79e176173cd70b843492dd231a978
commit a85c5000abb79e176173cd70b843492dd231a978
Author: Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Sun Aug 4 12:07:58 2013 +0200
Commit: Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Sun Aug 4 12:07:58 2013 +0200
CXXFeatures: add support for XL
Information taken from:
https://www.ibm.com/developerworks/community/blogs/5894415f-be62-4bc0-81c5-3956e82276f3/entry/xlc_compiler_s_c_11_support50?lang=en
diff --git a/Modules/FindCXXFeatures.cmake b/Modules/FindCXXFeatures.cmake
index c5d0c35..250bc7c 100644
--- a/Modules/FindCXXFeatures.cmake
+++ b/Modules/FindCXXFeatures.cmake
@@ -44,13 +44,20 @@ endif ()
### Check for needed compiler flags
#
include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXCompilerFlag.cmake)
-check_cxx_compiler_flag("-std=c++11" _HAS_CXX11_FLAG)
-if (_HAS_CXX11_FLAG)
- set(CXX11_COMPILER_FLAGS "-std=c++11")
-else ()
- check_cxx_compiler_flag("-std=c++0x" _HAS_CXX0X_FLAG)
+if (CMAKE_CXX_COMPILER_ID MATCHES "XL")
+ check_cxx_compiler_flag("-qlanglvl=extended0x" _HAS_CXX0X_FLAG)
if (_HAS_CXX0X_FLAG)
- set(CXX11_COMPILER_FLAGS "-std=c++0x")
+ set(CXX11_COMPILER_FLAGS "-qlanglvl=extended0x")
+ endif ()
+else ()
+ check_cxx_compiler_flag("-std=c++11" _HAS_CXX11_FLAG)
+ if (_HAS_CXX11_FLAG)
+ set(CXX11_COMPILER_FLAGS "-std=c++11")
+ else ()
+ check_cxx_compiler_flag("-std=c++0x" _HAS_CXX0X_FLAG)
+ if (_HAS_CXX0X_FLAG)
+ set(CXX11_COMPILER_FLAGS "-std=c++0x")
+ endif ()
endif ()
endif ()
diff --git a/Tests/Module/CXXFeatures/CMakeLists.txt b/Tests/Module/CXXFeatures/CMakeLists.txt
index 2242cda..50f9185 100644
--- a/Tests/Module/CXXFeatures/CMakeLists.txt
+++ b/Tests/Module/CXXFeatures/CMakeLists.txt
@@ -29,8 +29,9 @@ unset(_compiler_unknown_features)
if (CMAKE_COMPILER_IS_GNUCXX)
# no idea since when this is supported, but it is at least
# supported since 3.1
- set(_expected_features CXXFeatures_long_long_FOUND
- CXXFeatures_func_identifier_FOUND)
+ list(APPEND _expected_features
+ CXXFeatures_long_long_FOUND
+ CXXFeatures_func_identifier_FOUND)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
set(_expected_features ${_all_cxx_features})
@@ -39,27 +40,27 @@ if (CMAKE_COMPILER_IS_GNUCXX)
set(_expected_cxx11_flag "-std=c++0x")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
list(APPEND _expected_features
- CXXFeatures_nullptr_FOUND)
+ CXXFeatures_nullptr_FOUND)
endif ()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.5)
list(APPEND _expected_features
- CXXFeatures_lambda_FOUND)
+ CXXFeatures_lambda_FOUND)
endif ()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
list(APPEND _expected_features
- CXXFeatures_auto_FOUND
- CXXFeatures_constexpr_FOUND
- CXXFeatures_cstdint_header_FOUND
- CXXFeatures_defaulted_functions_FOUND
- CXXFeatures_deleted_functions_FOUND
- CXXFeatures_initializer_list_FOUND
- CXXFeatures_sizeof_member_FOUND)
+ CXXFeatures_auto_FOUND
+ CXXFeatures_constexpr_FOUND
+ CXXFeatures_cstdint_header_FOUND
+ CXXFeatures_defaulted_functions_FOUND
+ CXXFeatures_deleted_functions_FOUND
+ CXXFeatures_initializer_list_FOUND
+ CXXFeatures_sizeof_member_FOUND)
endif ()
list(APPEND _expected_features
- CXXFeatures_decltype_FOUND
- CXXFeatures_rvalue_references_FOUND
- CXXFeatures_static_assert_FOUND
- CXXFeatures_variadic_templates_FOUND)
+ CXXFeatures_decltype_FOUND
+ CXXFeatures_rvalue_references_FOUND
+ CXXFeatures_static_assert_FOUND
+ CXXFeatures_variadic_templates_FOUND)
endif ()
elseif (MSVC)
if (NOT MSVC_VERSION VERSION_LESS 1700)
@@ -80,8 +81,28 @@ elseif (MSVC)
list(APPEND _expected_features
CXXFeatures_long_long_FOUND)
endif ()
-elseif (CMAKE_CXX_COMPILER_ID MATCHES Borland)
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "Borland")
# nothing supported
+elseif (CMAKE_CXX_COMPILER_ID MATCHES "XL")
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.1)
+ set(_expected_cxx11_flag "-qlanglvl=extended0x")
+ list(APPEND _expected_features
+ CXXFeatures_long_long_FOUND)
+ endif ()
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.1)
+ list(APPEND _expected_features
+ CXXFeatures_auto_FOUND
+ CXXFeatures_decltype_FOUND
+ CXXFeatures_static_assert_FOUND
+ CXXFeatures_variadic_templates_FOUND)
+ )
+ endif ()
+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.1)
+ list(APPEND _expected_features
+ CXXFeatures_constexpr_FOUND
+ CXXFeatures_rvalue_references_FOUND)
+ )
+ endif ()
else ()
message(WARNING "Your C++ compiler configuration is not in the list of known configurations")
set(_compiler_unknown_features TRUE)
-----------------------------------------------------------------------
Summary of changes:
Modules/FindCXXFeatures.cmake | 19 +++++++---
Tests/Module/CXXFeatures/CMakeLists.txt | 53 +++++++++++++++++++++---------
2 files changed, 50 insertions(+), 22 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list