Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove spurious non breaking spaces, grrr
[simgrid.git] / tools / cmake / MakeLib.cmake
index 1378bd4..d7c456a 100644 (file)
@@ -5,7 +5,7 @@
 set(MACOSX_RPATH ON)
 if(APPLE)
   # add the current location of libsimgrid-java.dynlib as a location for libsimgrid.dynlib
-  # (useful when unpacking the native libraries from the jarfile)
+  # (useful when unpacking the native libraries from the jarfile)
   set(CMAKE_INSTALL_RPATH "@loader_path/.")
   SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 endif()
@@ -34,9 +34,8 @@ if (HAVE_BOOST_CONTEXTS)
   set(SIMGRID_DEP "${SIMGRID_DEP} ${Boost_CONTEXT_LIBRARY}")
 endif()
 
-if(HAVE_PTHREAD AND ${HAVE_THREAD_CONTEXTS} AND NOT APPLE)
-  # Clang on recent Mac OS X is not happy about -pthread.
-  SET(SIMGRID_DEP "${SIMGRID_DEP} -pthread")
+if(CMAKE_USE_PTHREADS_INIT AND ${HAVE_THREAD_CONTEXTS})
+  set(SIMGRID_DEP "${SIMGRID_DEP} ${CMAKE_THREAD_LIBS_INIT}")
 endif()
 
 if(SIMGRID_HAVE_LUA)