Add multithreading option for CMake

This commit is contained in:
GoldenTails 2020-10-20 15:44:01 -05:00
parent 7952408c8e
commit 31c410656c
2 changed files with 8 additions and 0 deletions

View File

@ -231,6 +231,8 @@ set(SRB2_CONFIG_HAVE_OPENMPT ON CACHE BOOL
"Enable OpenMPT support.")
set(SRB2_CONFIG_HAVE_CURL ON CACHE BOOL
"Enable curl support, used for downloading files via HTTP.")
set(SRB2_CONFIG_HAVE_THREADS ON CACHE BOOL
"Enable multithreading support.")
if(${CMAKE_SYSTEM} MATCHES Windows)
set(SRB2_CONFIG_HAVE_MIXERX ON CACHE BOOL
"Enable SDL Mixer X support.")

View File

@ -55,6 +55,12 @@ set(SRB2_SDL2_HEADERS
sdlmain.h
)
if(${SRB2_CONFIG_HAVE_THREADS})
set(SRB2_HAVE_THREADS ON)
set(SRB2_SDL2_SOURCES ${SRB2_SDL2_SOURCES} i_threads.c)
add_definitions(-DHAVE_THREADS)
endif()
source_group("Interface Code" FILES ${SRB2_SDL2_SOURCES} ${SRB2_SDL2_HEADERS})
# Dependency