diff options
author | Chris Bieneman <beanz@apple.com> | 2017-02-07 23:32:56 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2017-02-07 23:32:56 +0000 |
commit | 3aa9ab7ce6a52f33e4f3403aa58dd6b8f77811ab (patch) | |
tree | 31aa0e3e9a52084dbb6e3a71d37904644050b0d2 /CMakeLists.txt | |
parent | f31871c702c2b6d09797a2c8f830d21d8f20175c (diff) |
[CMake] Allow overriding CMAKE_LIBTOOL
This patch allows a user to specify a their own libtool instead of auto-detecting one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fa7790642b4..df6ef8efedb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,17 +56,20 @@ endif() # This should only apply if you are both on an Apple host, and targeting Apple. if(CMAKE_HOST_APPLE AND APPLE) - if(NOT CMAKE_XCRUN) - find_program(CMAKE_XCRUN NAMES xcrun) - endif() - if(CMAKE_XCRUN) - execute_process(COMMAND ${CMAKE_XCRUN} -find libtool - OUTPUT_VARIABLE CMAKE_LIBTOOL - OUTPUT_STRIP_TRAILING_WHITESPACE) - endif() + # if CMAKE_LIBTOOL is not set, try and find it with xcrun or find_program + if(NOT CMAKE_LIBTOOL) + if(NOT CMAKE_XCRUN) + find_program(CMAKE_XCRUN NAMES xcrun) + endif() + if(CMAKE_XCRUN) + execute_process(COMMAND ${CMAKE_XCRUN} -find libtool + OUTPUT_VARIABLE CMAKE_LIBTOOL + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif() - if(NOT CMAKE_LIBTOOL OR NOT EXISTS CMAKE_LIBTOOL) - find_program(CMAKE_LIBTOOL NAMES libtool) + if(NOT CMAKE_LIBTOOL OR NOT EXISTS CMAKE_LIBTOOL) + find_program(CMAKE_LIBTOOL NAMES libtool) + endif() endif() get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES) |