diff --git a/cmake/modules/CheckCXXFeatures.cmake b/cmake/modules/CheckCXXFeatures.cmake index 5c4bd828c1d301a253d77dc1fd5c0b3c888a9f36..d8f922837592b1dae75880fb9d089a89218200a6 100644 --- a/cmake/modules/CheckCXXFeatures.cmake +++ b/cmake/modules/CheckCXXFeatures.cmake @@ -481,3 +481,15 @@ check_cxx_source_compiles(" } " DUNE_SUPPORTS_CXX_THROW_IN_CONSTEXPR ) + + +# Check whether the compiler supports inline variables +check_cxx_source_compiles(" + inline int foo = 42; + + int main() + { + return not (foo == 42); + } +" DUNE_HAVE_CXX_INLINE_VARIABLES + ) diff --git a/config.h.cmake b/config.h.cmake index fa6b9d21195fd6f8f3e464f1edae4ab649ce15e7..a15ab8a8d117c4699c70bfdba62cb2843b70dd70 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -35,6 +35,9 @@ /* does the compiler support conditionally throwing exceptions in constexpr context? */ #cmakedefine DUNE_SUPPORTS_CXX_THROW_IN_CONSTEXPR 1 +/* does the compiler support inline variables? */ +#cmakedefine DUNE_HAVE_CXX_INLINE_VARIABLES 1 + /* Define if you have a BLAS library. */ #cmakedefine HAVE_BLAS 1