From: Martin Quinson Date: Tue, 1 Nov 2016 20:09:44 +0000 (+0100) Subject: Fix MC builds after my fix for Mac OSX around libunwind :-( X-Git-Tag: v3_14~251 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/182a4405d85c87f52db5fcd8eaf8b04d3b27a3c8?ds=sidebyside Fix MC builds after my fix for Mac OSX around libunwind :-( --- diff --git a/tools/cmake/Modules/FindLibunwind.cmake b/tools/cmake/Modules/FindLibunwind.cmake index 711f0ca1f3..bce74ff8e6 100644 --- a/tools/cmake/Modules/FindLibunwind.cmake +++ b/tools/cmake/Modules/FindLibunwind.cmake @@ -15,13 +15,9 @@ if(PROCESSOR_x86_64) endif() if(NOT PATH_LIBUNWIND_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 + find_library(PATH_LIBUNWIND_LIB + NAMES unwind + HINTS $ENV{SIMGRID_LIBUNWIND_LIBRARY_PATH} $ENV{LD_LIBRARY_PATH} $ENV{LIBUNWIND_LIBRARY_PATH} @@ -33,6 +29,13 @@ 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()