Skip to content

Commit 6f67d26

Browse files
committed
cmake: get rid off warning "D9025: overriding '/openmp' with '/openmp:llvm'" (cmake >= 3.30 needed)
1 parent c1bb752 commit 6f67d26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,10 @@ if(OPENMP_BUILD
320320
set(OPENMP_BUILD OFF)
321321
endif()
322322
if(OPENMP_BUILD)
323-
find_package(OpenMP QUIET)
323+
if(MSVC) # supported from cmake 3.30
324+
set(OpenMP_RUNTIME_MSVC "llvm")
325+
endif(MSVC)
326+
find_package(OpenMP)
324327
# https://stackoverflow.com/questions/12399422
325328
# how-to-set-linker-flags-for-openmp-in-cmakes-try-compile-function
326329
if(NOT OpenMP_FOUND

0 commit comments

Comments
 (0)