From: Martin Quinson Date: Tue, 1 Nov 2016 19:38:55 +0000 (+0100) Subject: another try to fix mac OSX (libunwind is not the one we think there) X-Git-Tag: v3_14~253 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9c86848003d4afae78da6c02d5b4e5fc7721a066?ds=inline another try to fix mac OSX (libunwind is not the one we think there) --- diff --git a/tools/cmake/Modules/FindLibunwind.cmake b/tools/cmake/Modules/FindLibunwind.cmake index 67bcde67ae..711f0ca1f3 100644 --- a/tools/cmake/Modules/FindLibunwind.cmake +++ b/tools/cmake/Modules/FindLibunwind.cmake @@ -15,20 +15,25 @@ if(PROCESSOR_x86_64) endif() if(NOT PATH_LIBUNWIND_LIB) - find_library(PATH_LIBUNWIND_LIB - NAMES unwind - HINTS - $ENV{SIMGRID_LIBUNWIND_LIBRARY_PATH} - $ENV{LD_LIBRARY_PATH} - $ENV{LIBUNWIND_LIBRARY_PATH} - PATH_SUFFIXES lib/ GnuWin32/lib lib/system - PATHS - /opt - /opt/local - /opt/csw - /sw - /usr - /usr/lib/) + # 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} + PATH_SUFFIXES lib/ GnuWin32/lib lib/system + PATHS + /opt + /opt/local + /opt/csw + /sw + /usr + /usr/lib/) + endif() endif() find_path(PATH_LIBUNWIND_H "libunwind.h"