summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-02-04 07:28:30 +0000
committerJustin Bogner <mail@justinbogner.com>2016-02-04 07:28:30 +0000
commite12385bd6a764aed0384ab3b5376030ec4159024 (patch)
tree9c601d4a154efe9fdcf03e01f7f5aa76dd3a0de8 /llvm/cmake/modules
parentd7ccafe35f292401f7e3905d67cf5122fa1bb380 (diff)
downloadbcm5719-llvm-e12385bd6a764aed0384ab3b5376030ec4159024.tar.gz
bcm5719-llvm-e12385bd6a764aed0384ab3b5376030ec4159024.zip
cmake: Add a flag to enable LTO
This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually add -flto to the various _FLAGS variables. llvm-svn: 259766
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 9b6a590920e..99b23180bbb 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -656,6 +656,13 @@ append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate"
CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS)
+option(LLVM_ENABLE_LTO "Enable link-time optimization" OFF)
+append_if(LLVM_ENABLE_LTO "-flto"
+ CMAKE_CXX_FLAGS
+ CMAKE_C_FLAGS
+ CMAKE_EXE_LINKER_FLAGS
+ CMAKE_SHARED_LINKER_FLAGS)
+
# Plugin support
# FIXME: Make this configurable.
if(WIN32 OR CYGWIN)
OpenPOWER on IntegriCloud