From bd548ce060f6a70bdd19801c1ccbe51be405f531 Mon Sep 17 00:00:00 2001 From: Benitoite Date: Thu, 16 May 2019 12:39:08 -0700 Subject: [PATCH] Mac: define CMAKE_AR / RANLIB only if undefined. --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f13231586..128551b02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,8 +358,12 @@ if(WITH_LTO) string(REGEX REPLACE ".* ([0-9.]+)\n.*" "\\1" BINUTILS_VERSION_DETECTED "${BINUTILS_VERSION_DETECTED}") if("${BINUTILS_VERSION_DETECTED}" VERSION_LESS "${BINUTILS_VERSION_MININUM}") if(APPLE) - set(CMAKE_AR "/opt/local/bin/ar") - set(CMAKE_RANLIB "/opt/local/bin/ranlib") + if(!CMAKE_AR) + set(CMAKE_AR "/opt/local/bin/ar") + endif() + if(!CMAKE_RANLIB) + set(CMAKE_RANLIB "/opt/local/bin/ranlib") + endif() else() set(CMAKE_AR "/usr/bin/gcc-ar") set(CMAKE_RANLIB "/usr/bin/gcc-ranlib")