diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a80759..c3753d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,13 @@ if(COMPILER_SUPPORTS_CXX20) else() message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++20 support. Please use a different C++ compiler.") endif() +# OpenMP is required +CHECK_CXX_COMPILER_FLAG(-fopenmp COMPILER_SUPPORTS_OPENMP) +if(COMPILER_SUPPORTS_OPENMP) + set(default_options ${default_options} -fopenmp) +else() + message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no OpenMP support. Please use a different C++ compiler.") +endif() # Link time optimization check set(CMAKE_REQUIRED_FLAGS -flto) CHECK_CXX_COMPILER_FLAG(-flto COMPILER_SUPPORTS_FLTO)