From 730c065ee756ce39aca14b680361a2270dfec49c Mon Sep 17 00:00:00 2001 From: Miroslav Lences Date: Sat, 29 Dec 2018 03:05:20 +0100 Subject: [PATCH] Fix macos build issues --- CMakeLists.txt | 8 +++++--- dist/macos/bundle/reref_dylibs.sh | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11f34690..ba130f50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,8 +311,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") ${OPENSSL_ROOT}/lib/ssleay32.lib ) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - - if (IS_DIRECTORY /opt/local) + find_program(BREW_PROGRAM "brew") + find_program(PORT_PROGRAM "ports") + + if (IS_DIRECTORY /opt/local AND PORT_PROGRAM) # macports set (OPENSSL_ROOT /opt/local) @@ -321,7 +323,7 @@ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ${OPENSSL_ROOT}/lib/libcrypto.a z ) - elseif (IS_DIRECTORY /usr/local/opt/openssl) + elseif (IS_DIRECTORY /usr/local/opt/openssl AND BREW_PROGRAM) # brew set (OPENSSL_ROOT /usr/local/opt/openssl) diff --git a/dist/macos/bundle/reref_dylibs.sh b/dist/macos/bundle/reref_dylibs.sh index 15191bd2..c06c7410 100755 --- a/dist/macos/bundle/reref_dylibs.sh +++ b/dist/macos/bundle/reref_dylibs.sh @@ -21,6 +21,8 @@ B_LIBS=$(otool -XL $B_TARGET | awk '{ print $1 }' | grep -Ev '^(/usr/lib|/System [ $? -ne 0 ] && exit 1 for B_LIB in $B_LIBS; do B_LIB_NAME=$(basename $B_LIB) + # otool reports barrier as "barrier:" which fails self-reference test below + B_LIB_NAME=${B_LIB_NAME//:} # ignore self-references [ "$B_TARGET" = "$B_LIB_NAME" ] && continue