mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
FindCXX11Features.cmake: check for the c++-2011 "final" specifier
This commit is contained in:
committed by
Atgeirr Flø Rasmussen
parent
e0dd62a226
commit
e2180effce
@@ -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>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
set (opm-material_CONFIG_VAR
|
||||
HAVE_MPI
|
||||
HAVE_VALGRIND
|
||||
HAVE_FINAL
|
||||
)
|
||||
|
||||
# dependencies
|
||||
|
||||
Reference in New Issue
Block a user