From 182a4405d85c87f52db5fcd8eaf8b04d3b27a3c8 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 1 Nov 2016 21:09:44 +0100 Subject: [PATCH] Fix MC builds after my fix for Mac OSX around libunwind :-( --- tools/cmake/Modules/FindLibunwind.cmake | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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() -- 2.20.1