From fc68616153190212a7bb7226cdffaa0e6dd4fdb0 Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Tue, 7 Mar 2023 11:38:00 +1000 Subject: [PATCH] OpenMP required (but still not used) for compilation. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) 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)