mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Add check for noexcept when checking C++11 features
This commit is contained in:
@@ -96,7 +96,7 @@ IF(LIBTINS_ENABLE_CXX11)
|
||||
# We only use declval and decltype on gcc/clang as VC fails to build that code,
|
||||
# at least on VC2013
|
||||
IF(HAS_CXX11_RVALUE_REFERENCES AND HAS_CXX11_FUNCTIONAL AND HAS_CXX11_CHRONO AND
|
||||
((HAS_CXX11_DECLVAL AND HAS_CXX11_DECLTYPE) OR MSVC))
|
||||
HAS_CXX11_NOEXCEPT AND ((HAS_CXX11_DECLVAL AND HAS_CXX11_DECLTYPE) OR MSVC))
|
||||
SET(TINS_HAVE_CXX11 ON)
|
||||
MESSAGE(STATUS "Enabling C++11 features")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_COMPILER_FLAGS}")
|
||||
|
||||
@@ -125,23 +125,11 @@ function(cxx11_check_feature FEATURE_NAME RESULT_VAR)
|
||||
endif (NOT DEFINED ${RESULT_VAR})
|
||||
endfunction(cxx11_check_feature)
|
||||
|
||||
#cxx11_check_feature("regex" HAS_CXX11_LIB_REGEX)
|
||||
#cxx11_check_feature("__func__" HAS_CXX11_FUNC)
|
||||
#cxx11_check_feature("auto" HAS_CXX11_AUTO)
|
||||
#cxx11_check_feature("auto_ret_type" HAS_CXX11_AUTO_RET_TYPE)
|
||||
#cxx11_check_feature("class_override_final" HAS_CXX11_CLASS_OVERRIDE)
|
||||
#cxx11_check_feature("constexpr" HAS_CXX11_CONSTEXPR)
|
||||
#cxx11_check_feature("cstdint" HAS_CXX11_CSTDINT_H)
|
||||
#cxx11_check_feature("lambda" HAS_CXX11_LAMBDA)
|
||||
#cxx11_check_feature("long_long" HAS_CXX11_LONG_LONG)
|
||||
#cxx11_check_feature("nullptr" HAS_CXX11_NULLPTR)
|
||||
#cxx11_check_feature("sizeof_member" HAS_CXX11_SIZEOF_MEMBER)
|
||||
#cxx11_check_feature("static_assert" HAS_CXX11_STATIC_ASSERT)
|
||||
#cxx11_check_feature("variadic_templates" HAS_CXX11_VARIADIC_TEMPLATES)
|
||||
cxx11_check_feature("decltype" HAS_CXX11_DECLTYPE)
|
||||
cxx11_check_feature("declval" HAS_CXX11_DECLVAL)
|
||||
cxx11_check_feature("initializer_list" HAS_CXX11_INITIALIZER_LIST)
|
||||
cxx11_check_feature("rvalue-references" HAS_CXX11_RVALUE_REFERENCES)
|
||||
cxx11_check_feature("functional" HAS_CXX11_FUNCTIONAL)
|
||||
cxx11_check_feature("chrono" HAS_CXX11_CHRONO)
|
||||
cxx11_check_feature("noexcept" HAS_CXX11_NOEXCEPT)
|
||||
cxx11_check_feature("builtin-swap" HAS_GCC_BUILTIN_SWAP)
|
||||
|
||||
7
cmake/Modules/CheckCXXFeatures/cxx-test-noexcept.cpp
Normal file
7
cmake/Modules/CheckCXXFeatures/cxx-test-noexcept.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
int foo() noexcept {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
return foo();
|
||||
}
|
||||
Reference in New Issue
Block a user