From 08f687af33291f42907b943bec9a0acf7b9f874c Mon Sep 17 00:00:00 2001 From: degomme Date: Wed, 2 Nov 2016 14:40:00 +0100 Subject: [PATCH] Revert "Fix MC builds after my fix for Mac OSX around libunwind :-(" This reverts commit 182a4405d85c87f52db5fcd8eaf8b04d3b27a3c8. --- tools/cmake/Modules/FindLibunwind.cmake | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) 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() -- 2.20.1