Skip to content

Commit 765b390

Browse files
committed
cmake: add OpenMP support
1 parent d2a30a8 commit 765b390

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cmake/DaemonFlags.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,18 @@ else()
362362
endif()
363363
endif()
364364

365+
if ((NOT NACL AND NOT BUILD_CGAME AND NOT BUILD_SGAME)
366+
AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMMY_APP))
367+
option(USE_OPENMP "Use OpenMP to parallelize some tasks" OFF)
368+
369+
if (USE_OPENMP)
370+
try_cxx_flag(FOPENMP "-fopenmp")
371+
if (NOT FLAG_FOPENMP)
372+
message(WARNING "Missing OpenMP")
373+
endif()
374+
endif()
375+
endif()
376+
365377
if (NACL AND USE_NACL_SAIGO AND SAIGO_ARCH STREQUAL "arm")
366378
# This should be set for every build type because build type flags
367379
# are set after the other custom flags and then have the last word.

0 commit comments

Comments
 (0)