FindCXX11Features.cmake: check for the c++-2011 "final" specifier

This commit is contained in:
Andreas Lauser
2015-03-26 23:52:32 +01:00
committed by Atgeirr Flø Rasmussen
parent e0dd62a226
commit e2180effce
2 changed files with 18 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
#
# Sets the follwing variable:
#
# HAVE_FINAL True if the compiler supports the "final" quantifier
# HAVE_TYPE_TRAITS True if the <type_traits> header is available and implements sufficient functionality
# HAVE_SHARED_PTR True if std::shared_ptr is available
# HAVE_UNIQUE_PTR True if std::unique_ptr is available
@@ -70,6 +71,22 @@ endif (CXX_STD0X_FLAGS AND CXX_STDLIB_FLAGS)
# perform tests
include(CheckCXXSourceCompiles)
# the "final" method specifier
CHECK_CXX_SOURCE_COMPILES("
struct Base {
virtual void foo() = 0;
};
struct Derived : public Base {
virtual void foo() final {};
};
int main()
{
return 0;
}
" HAVE_FINAL
)
# std::is_convertible, std::is_base_of
CHECK_CXX_SOURCE_COMPILES("
#include <type_traits>

View File

@@ -5,6 +5,7 @@
set (opm-material_CONFIG_VAR
HAVE_MPI
HAVE_VALGRIND
HAVE_FINAL
)
# dependencies