X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5dd32633734c45f8697bab68eb972a2bb6a415a6..08f687af33291f42907b943bec9a0acf7b9f874c:/tools/cmake/Modules/FindLibunwind.cmake diff --git a/tools/cmake/Modules/FindLibunwind.cmake b/tools/cmake/Modules/FindLibunwind.cmake index bce74ff8e6..711f0ca1f3 100644 --- a/tools/cmake/Modules/FindLibunwind.cmake +++ b/tools/cmake/Modules/FindLibunwind.cmake @@ -15,9 +15,13 @@ if(PROCESSOR_x86_64) endif() if(NOT PATH_LIBUNWIND_LIB) - find_library(PATH_LIBUNWIND_LIB - NAMES unwind - HINTS + # Mac OSX has a libunwind that is not the one we need + CHECK_LIBRARY_EXISTS(unwind unw_init_local "Whether libunwind is usable" RIGHT_LIBUNWIND) + + if (RIGHT_LIBUNWIND) + find_library(PATH_LIBUNWIND_LIB + NAMES unwind + HINTS $ENV{SIMGRID_LIBUNWIND_LIBRARY_PATH} $ENV{LD_LIBRARY_PATH} $ENV{LIBUNWIND_LIBRARY_PATH} @@ -29,13 +33,6 @@ if(NOT PATH_LIBUNWIND_LIB) /sw /usr /usr/lib/) - - # Mac OSX has a libunwind that is not the one we need, so double check - if (PATH_LIBUNWIND_LIB) - CHECK_LIBRARY_EXISTS(unwind unw_init_local PATH_LIBUNWIND_LIB RIGHT_LIBUNWIND) - if (NOT RIGHT_LIBUNWIND) - unset(PATH_LIBUNWIND_LIB) - endif() endif() endif()