mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-06-08 08:13:55 +00:00
CMake: Use Threads instead of pthread directly
On some systems, such as Android, threads are not provided via `-lpthread`. CMake comes with a built-in module for finding the correct threads library. Use it to fix the linking issue on Android and possibly other systems.
This commit is contained in:
@@ -180,7 +180,8 @@ ELSE(WIN32)
|
||||
ENDIF(BUILD_CLSOCKET)
|
||||
|
||||
IF(NOT APPLE)
|
||||
LINK_LIBRARIES( pthread ${DL} )
|
||||
FIND_PACKAGE(Threads)
|
||||
LINK_LIBRARIES( ${CMAKE_THREAD_LIBS_INIT} ${DL} )
|
||||
ENDIF(NOT APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
@@ -146,7 +146,8 @@ ELSE(WIN32)
|
||||
ENDIF(BUILD_CLSOCKET)
|
||||
|
||||
IF(NOT APPLE)
|
||||
LINK_LIBRARIES( pthread ${DL} )
|
||||
FIND_PACKAGE(Threads)
|
||||
LINK_LIBRARIES( ${CMAKE_THREAD_LIBS_INIT} ${DL} )
|
||||
ENDIF(NOT APPLE)
|
||||
ENDIF(WIN32)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user