Try fixing a compilation error when pthread does not exist.

This commit is contained in:
David Reid
2025-08-20 18:07:59 +10:00
parent ba84e61a18
commit b7e5451ef4
+7
View File
@@ -458,8 +458,15 @@ if (UNIX)
endif()
endif()
find_library(LIB_PTHREAD NAMES pthread)
if(LIB_PTHREAD)
list(APPEND COMMON_LINK_LIBRARIES pthread) # Some compilers will not link to pthread by default so list it here just in case.
endif()
find_library(LIB_M NAMES m)
if(LIB_M)
list(APPEND COMMON_LINK_LIBRARIES m)
endif()
# If we're compiling for 32-bit ARM we need to link to -latomic.
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")