Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 4b5f4e5

Browse files
author
Chris Bieneman
committed
[CMake] Add DARWIN_LTO_LIBRARY option to allow overriding -lto_library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247308 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a37234f commit 4b5f4e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,13 @@ else(UNIX)
543543
endif(NOT DEFINED CMAKE_INSTALL_RPATH)
544544
endif()
545545

546+
if(APPLE AND DARWIN_LTO_LIBRARY)
547+
set(CMAKE_EXE_LINKER_FLAGS
548+
"${CMAKE_EXE_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
549+
set(CMAKE_SHARED_LINKER_FLAGS
550+
"${CMAKE_SHARED_LINKER_FLAGS} -Wl,-lto_library -Wl,${DARWIN_LTO_LIBRARY}")
551+
endif()
552+
546553
# Work around a broken bfd ld behavior. When linking a binary with a
547554
# foo.so library, it will try to find any library that foo.so uses and
548555
# check its symbols. This is wasteful (the check was done when foo.so

0 commit comments

Comments
 (0)