We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6f6737 commit 978877fCopy full SHA for 978877f
1 file changed
CMakeLists.txt
@@ -68,7 +68,16 @@ add_executable(next ${SRC_FILES} ${ARGPARSE_FILES})
68
find_package(OpenMP QUIET)
69
if(OpenMP_CXX_FOUND)
70
message(STATUS "OpenMP detected — enabling multithreading.")
71
- target_link_libraries(next PRIVATE OpenMP::OpenMP_CXX)
+
72
+ if(MSVC)
73
+ # Force MSVC to use the modern LLVM backend (supports OpenMP 3.0+ and size_t)
74
+ # We add it as a compiler option because MSVC's default find_package
75
+ # often defaults to the legacy /openmp flag.
76
+ target_compile_options(next PRIVATE /openmp:llvm)
77
+ else()
78
+ target_link_libraries(next PRIVATE OpenMP::OpenMP_CXX)
79
+ endif()
80
81
else()
82
message(STATUS "OpenMP not found — building in single-threaded mode.")
83
endif()
0 commit comments