[Bf-blender-cvs] [eb515f4] master: CMake: cleanup, use find_package for pthreads

Campbell Barton noreply at git.blender.org
Sat Nov 15 16:46:46 CET 2014


Commit: eb515f4dc88ed8a1ad13f3127791cced5fbfe8b3
Author: Campbell Barton
Date:   Sat Nov 15 16:46:30 2014 +0100
Branches: master
https://developer.blender.org/rBeb515f4dc88ed8a1ad13f3127791cced5fbfe8b3

CMake: cleanup, use find_package for pthreads

===================================================================

M	CMakeLists.txt

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b2e5b9..3465788 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)




More information about the Bf-blender-cvs mailing list