Commit b7e5451e authored by David Reid's avatar David Reid

Try fixing a compilation error when pthread does not exist.

parent ba84e61a
......@@ -458,8 +458,15 @@ if (UNIX)
endif()
endif()
list(APPEND COMMON_LINK_LIBRARIES pthread) # Some compilers will not link to pthread by default so list it here just in case.
list(APPEND COMMON_LINK_LIBRARIES m)
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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment