X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed9c3b8964af94ae8531b3c3518f4267c794aaf..9e568a13c5bf3fea2a09bb4418f2465fa759af3b:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index a14e39001b..d1bf3e841c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,7 @@ string(REGEX MATCH "[0-9].[0-9]*" LINKER_VERSION "${LINKER_VERSION}") ### Set the library providing dlopen if("${CMAKE_SYSTEM}" MATCHES "Linux") - find_library(dl DL_LIBRARY) + find_library(DL_LIBRARY dl) endif("${CMAKE_SYSTEM}" MATCHES "Linux") ### Find programs and paths @@ -305,6 +305,7 @@ CHECK_INCLUDE_FILE("ucontext.h" HAVE_UCONTEXT_H) CHECK_INCLUDE_FILE("linux/futex.h" HAVE_FUTEX_H) CHECK_FUNCTION_EXISTS(backtrace HAVE_BACKTRACE) +CHECK_FUNCTION_EXISTS(dlfunc HAVE_DLFUNC) CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) CHECK_FUNCTION_EXISTS(nanosleep HAVE_NANOSLEEP) CHECK_FUNCTION_EXISTS(getdtablesize HAVE_GETDTABLESIZE) @@ -363,16 +364,22 @@ endif() include(FindLibunwind) if(HAVE_LIBUNWIND) - SET(SIMGRID_DEP "${SIMGRID_DEP} -lunwind") + if(NOT APPLE) + SET(SIMGRID_DEP "${SIMGRID_DEP} -lunwind") + else() + # Apple forbids to link directly against its libunwind implementation + # So let's comply and link against the System framework + SET(SIMGRID_DEP "${SIMGRID_DEP} -lSystem") + endif() if("${CMAKE_SYSTEM}" MATCHES "Linux") set(SIMGRID_DEP "${SIMGRID_DEP} -lunwind-ptrace") - endif() - # This supposes that the host machine is either an AMD or a X86. - # This is deeply wrong, and should be fixed by manually loading -lunwind-PLAT (FIXME) - if(PROCESSOR_x86_64) - SET(SIMGRID_DEP "${SIMGRID_DEP} -lunwind-x86_64") - else() - SET(SIMGRID_DEP "${SIMGRID_DEP} -lunwind-x86") + # This supposes that the host machine is either an AMD or a X86. + # This is deeply wrong, and should be fixed by manually loading -lunwind-PLAT (FIXME) + if(PROCESSOR_x86_64) + SET(SIMGRID_DEP "${SIMGRID_DEP} -lunwind-x86_64") + else() + SET(SIMGRID_DEP "${SIMGRID_DEP} -lunwind-x86") + endif() endif() else() if(enable_model-checking)