diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2e5b95663..34657888cc0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1070,7 +1070,14 @@ if(UNIX AND NOT APPLE) endif() # OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed - list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm -lpthread) + list(APPEND PLATFORM_LINKLIBS -lutil -lc -lm) + + find_package(Threads REQUIRED) + list(APPEND PLATFORM_LINKLIBS ${CMAKE_THREAD_LIBS_INIT}) + + if(CMAKE_DL_LIBS) + list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS}) + endif() if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(NOT WITH_PYTHON_MODULE) @@ -1080,11 +1087,6 @@ if(UNIX AND NOT APPLE) endif() endif() - set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -pthread") - if(CMAKE_DL_LIBS) - list(APPEND PLATFORM_LINKLIBS ${CMAKE_DL_LIBS}) - endif() - # lfs on glibc, all compilers should use add_definitions(-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE) |