Skip to content
Snippets Groups Projects
Commit 7de4637e authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[buildsystem] Don't rely on a define from a header to detect that header

We can't use a define from a header (__cpp_lib_experimental_detect in
this case) to detect whether we should include the header. Without
C++17 __has_include, CMake will have to do the work after all.
parent 4ce3a96f
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@
include(CMakePushCheckState)
include(CheckCXXCompilerFlag)
include(CheckIncludeFileCXX)
include(CheckCXXSourceCompiles)
# C++ standard versions that this test knows about
......@@ -462,3 +463,9 @@ check_cxx_source_compiles("
}
" DUNE_SUPPORTS_CXX_THROW_IN_CONSTEXPR
)
# Check whether we have <experimental/type_traits> (for is_detected et. al.)
check_include_file_cxx(
experimental/type_traits
DUNE_HAVE_HEADER_EXPERIMENTAL_TYPE_TRAITS
)
......@@ -32,6 +32,9 @@
/* does the compiler support conditionally throwing exceptions in constexpr context? */
#cmakedefine DUNE_SUPPORTS_CXX_THROW_IN_CONSTEXPR 1
/* does the standard library provide <experimental/type_traits> ? */
#cmakedefine DUNE_HAVE_HEADER_EXPERIMENTAL_TYPE_TRAITS 1
/* Define if you have a BLAS library. */
#cmakedefine HAVE_BLAS 1
......
......@@ -7,7 +7,7 @@
#include <dune/common/typetraits.hh>
#include <dune/common/typeutilities.hh>
#if __cpp_lib_experimental_detect >= 201505
#if DUNE_HAVE_HEADER_EXPERIMENTAL_TYPE_TRAITS
#include <experimental/type_traits>
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment