diff --git a/CMakeLists.txt b/CMakeLists.txt index 6cb5a6c84..7d082f261 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -320,7 +320,10 @@ if(OPENMP_BUILD set(OPENMP_BUILD OFF) endif() if(OPENMP_BUILD) - find_package(OpenMP QUIET) + if(MSVC) # supported from cmake 3.30 + set(OpenMP_RUNTIME_MSVC "llvm") + endif(MSVC) + find_package(OpenMP) # https://stackoverflow.com/questions/12399422 # how-to-set-linker-flags-for-openmp-in-cmakes-try-compile-function if(NOT OpenMP_FOUND