diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 962f8f87ac3bcd50b541b2d5f76c3e2b761e740e..3409c49d32330b3f64998c5fb79e828857714203 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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.")
@@ -470,6 +472,12 @@ if(${SRB2_CONFIG_HAVE_CURL})
 	endif()
 endif()
 
+if(${SRB2_CONFIG_HAVE_THREADS})
+	set(SRB2_HAVE_THREADS ON)
+	set(SRB2_CORE_HEADERS ${SRB2_CORE_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/i_threads.h)
+	add_definitions(-DHAVE_THREADS)
+endif()
+
 if(${SRB2_CONFIG_HWRENDER})
 	add_definitions(-DHWRENDER)
 	set(SRB2_HWRENDER_SOURCES
diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt
index 72f78188f2e642dc7ca774e2e1dad1e87008b751..bb5edf8170e486974c03e9a0e13437348d8eebd1 100644
--- a/src/sdl/CMakeLists.txt
+++ b/src/sdl/CMakeLists.txt
@@ -55,6 +55,10 @@ set(SRB2_SDL2_HEADERS
 	sdlmain.h
 )
 
+if(${SRB2_CONFIG_HAVE_THREADS})
+	set(SRB2_SDL2_SOURCES ${SRB2_SDL2_SOURCES} i_threads.c)
+endif()
+
 source_group("Interface Code" FILES ${SRB2_SDL2_SOURCES} ${SRB2_SDL2_HEADERS})
 
 # Dependency