diff --git a/CMakeLists.txt b/CMakeLists.txt index d865577674..a3f9840566 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,7 +282,7 @@ endif() set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}") # All other files are added via target_sources() -if (MINGW) +if (MINGW AND OPTION_MINGW_STDTHREADS) target_link_libraries(${OPENTTD_LIB} mingw_stdthreads) endif() diff --git a/src/3rdparty/CMakeLists.txt b/src/3rdparty/CMakeLists.txt index bc62e530ef..0ecb4593ca 100644 --- a/src/3rdparty/CMakeLists.txt +++ b/src/3rdparty/CMakeLists.txt @@ -6,7 +6,10 @@ add_subdirectory(squirrel) add_subdirectory(nlohmann) add_subdirectory(opengl) add_subdirectory(cpp-btree) -add_subdirectory(mingw-std-threads) add_subdirectory(monocypher) add_subdirectory(randombytes) add_subdirectory(robin_hood) + +if (MINGW AND OPTION_MINGW_STDTHREADS) + add_subdirectory(mingw-std-threads) +endif()