mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
bail out if some required C++-2011 features are not available
This commit is contained in:
@@ -46,6 +46,7 @@ set (${project}_DEPS
|
||||
${${PROJECT}_DEPENDS_LIST}
|
||||
)
|
||||
|
||||
|
||||
# C++ project
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
project(${${project}_NAME})
|
||||
@@ -92,6 +93,19 @@ include (UseWarnings)
|
||||
include (OpmFind)
|
||||
find_and_append_package_list_to (${project} ${${project}_DEPS})
|
||||
|
||||
# make sure the C++-2011 features which we rely on are supported
|
||||
if (NOT HAVE_ARRAY)
|
||||
message(FATAL_ERROR "std::array must be supported by the compiler for the ${project} module to work")
|
||||
endif()
|
||||
|
||||
if (NOT HAVE_STATIC_ASSERT)
|
||||
message(FATAL_ERROR "static assertations (via static_assert) must be supported for the ${project} module to work")
|
||||
endif()
|
||||
|
||||
if (NOT HAVE_AUTO)
|
||||
message(FATAL_ERROR "The 'auto' keyword must be supported by the compiler for the ${project} module to work")
|
||||
endif()
|
||||
|
||||
# put debug information into every executable
|
||||
include (UseDebugSymbols)
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
# HAVE_CONSTEXPR True if constexpr attribute is available
|
||||
# HAVE_INTEGRAL_CONSTANT True if compiler supports integral_constant
|
||||
# HAVE_STATIC_ASSERT True if static_assert is available
|
||||
# HAVE_VARIADIC_TEMPLATES True if variadic templates are supprt
|
||||
# HAVE_AUTO True if the compiler supports the auto keyword
|
||||
# HAVE_VARIADIC_TEMPLATES True if variadic templates are supported
|
||||
# HAVE_VARIADIC_CONSTRUCTOR_SFINAE True if variadic constructor sfinae is supported
|
||||
# HAVE_RVALUE_REFERENCES True if rvalue references are supported
|
||||
# HAVE_TUPLE True if std::tuple is available
|
||||
@@ -189,6 +190,16 @@ CHECK_CXX_SOURCE_COMPILES("
|
||||
" HAVE_STATIC_ASSERT
|
||||
)
|
||||
|
||||
# auto keyword
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
int main(void)
|
||||
{
|
||||
auto foo = 1.23;
|
||||
return 0;
|
||||
}
|
||||
" HAVE_AUTO
|
||||
)
|
||||
|
||||
# variadic template support
|
||||
CHECK_CXX_SOURCE_COMPILES("
|
||||
#include <cassert>
|
||||
|
||||
Reference in New Issue
Block a user