diff options
author | sfan5 <sfan5@live.de> | 2022-09-26 17:02:49 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-10-13 23:02:11 +0200 |
commit | f680d102599878b02c694127afb9260b5e53b8ed (patch) | |
tree | e27c0aae64e99cc94dae5ea3c7ab8fd935f1e764 /src | |
parent | e8ee4cb40d9ca3bb738ec2c3b320349f2a7dd733 (diff) | |
download | minetest-f680d102599878b02c694127afb9260b5e53b8ed.tar.xz |
Other minor CMake improvements
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f1e987f7..64aef356a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -241,6 +241,10 @@ endif() # Use cmake_config.h add_definitions(-DUSE_CMAKE_CONFIG_H) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +set(PLATFORM_LIBS Threads::Threads) + if(WIN32) # Windows if(MSVC) # MSVC Specifics @@ -251,8 +255,6 @@ if(WIN32) add_definitions(/D "_USE_MATH_DEFINES") # Dont define min/max macros in minwindef.h add_definitions(/D "NOMINMAX") - else() # Probably MinGW = GCC - set(PLATFORM_LIBS "") endif() set(PLATFORM_LIBS ws2_32.lib version.lib shlwapi.lib winmm.lib ${PLATFORM_LIBS}) @@ -282,7 +284,7 @@ else() endif(NOT HAIKU AND NOT APPLE) endif() - set(PLATFORM_LIBS -lpthread ${CMAKE_DL_LIBS}) + set(PLATFORM_LIBS ${PLATFORM_LIBS} ${CMAKE_DL_LIBS}) if(APPLE) set(PLATFORM_LIBS "-framework CoreFoundation" ${PLATFORM_LIBS}) else() |