X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a379f8a8381c6acf5ef1b29bca69cd758410c4c6..4c4e598644034fc1cc7498d70dc0b42bd6c4e744:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index e22357c33f..961bd16b24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -378,17 +378,24 @@ else() endif() include(FindLibunwind) -if(LIBUNWIND_FOUND) +if(HAVE_LIBUNWIND) if(NOT APPLE) - foreach(lib ${LIBUNWIND_LIBRARIES}) - SET(SIMGRID_DEP "${SIMGRID_DEP} ${lib}") - endforeach() - unset(lib) + 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|FreeBSD") + set(SIMGRID_DEP "${SIMGRID_DEP} -lunwind-ptrace") + # 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(SIMGRID_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) message(FATAL_ERROR "Please install libunwind-dev libdw-dev libelf-dev libevent-dev if you want to compile the SimGrid model checker.")