summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2016-04-28 20:14:19 +0000
committerChris Bieneman <beanz@apple.com>2016-04-28 20:14:19 +0000
commit6108658da4c2cef2d303c6a2fddfb60a5d589e69 (patch)
tree7e6d5c4c5cb91b0fdb203bf81df9e5cfca701e95 /llvm
parent4b627beea86a50b67cd8346fb4e35374576ad01d (diff)
downloadbcm5719-llvm-6108658da4c2cef2d303c6a2fddfb60a5d589e69.tar.gz
bcm5719-llvm-6108658da4c2cef2d303c6a2fddfb60a5d589e69.zip
[CMake] [Darwin] Use libtool instead of ar && ranlib
Summary: Using libtool instead of ar and ranlib on Darwin shaves a minute off my clang build. This is because on Darwin libtool is optimized to give hints to the kernel about filesystem interactions that allow it to be faster. Reviewers: bogner, pete Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19611 llvm-svn: 267930
Diffstat (limited to 'llvm')
-rw-r--r--llvm/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index e4d565c5535..771bce1f152 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -56,6 +56,21 @@ project(LLVM
${cmake_3_0_LANGUAGES}
C CXX ASM)
+if(APPLE)
+ if(NOT CMAKE_LIBTOOL)
+ find_program(CMAKE_LIBTOOL NAMES libtool)
+ endif()
+ if(CMAKE_LIBTOOL)
+ set(CMAKE_LIBTOOL ${CMAKE_LIBTOOL} CACHE PATH "libtool executable")
+ message(STATUS "Found libtool - ${CMAKE_LIBTOOL}")
+ get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+ foreach(lang ${languages})
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
+ "${CMAKE_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
+ endforeach()
+ endif()
+endif()
+
# The following only works with the Ninja generator in CMake >= 3.0.
set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
"Define the maximum number of concurrent compilation jobs.")
OpenPOWER on IntegriCloud