Mac: define CMAKE_AR / RANLIB only if undefined.

This commit is contained in:
Benitoite 2019-05-16 12:39:08 -07:00 committed by GitHub
parent 351f8f4e12
commit bd548ce060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")