summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-09-10 17:28:51 +0000
committerChris Bieneman <beanz@apple.com>2015-09-10 17:28:51 +0000
commita5478698bf4d7ed356621a29576e7259c082b25c (patch)
tree5851e06cd2b654b08aa1009eda0ddaec68e71d09
parentda1851ca58dc72ed781f0c36b6ef9c42ba9acf89 (diff)
downloadbcm5719-llvm-a5478698bf4d7ed356621a29576e7259c082b25c.tar.gz
bcm5719-llvm-a5478698bf4d7ed356621a29576e7259c082b25c.zip
[CMake] Add DARWIN_LTO_LIBRARY option to allow overriding -lto_library.
llvm-svn: 247308
-rw-r--r--llvm/CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index cabb661dbd3..3e54ec991f1 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -543,6 +543,13 @@ else(UNIX)
endif(NOT DEFINED CMAKE_INSTALL_RPATH)
endif()
+if(APPLE AND DARWIN_LTO_LIBRARY)
+ set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
+ set(CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
+endif()
+
# Work around a broken bfd ld behavior. When linking a binary with a
# foo.so library, it will try to find any library that foo.so uses and
# check its symbols. This is wasteful (the check was done when foo.so
OpenPOWER on IntegriCloud