diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-28 09:43:55 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-01-28 09:43:55 +0000 |
commit | 4fc67f04914586ea18695fdf758878fc174557c1 (patch) | |
tree | 494f0e81d9aa0eef5ad7cfaf897ed43e6d23629c /cmake/modules/AddLLVM.cmake | |
parent | 286d7d83128b591dc11cb1f1b59f13864270b812 (diff) | |
download | llvm-4fc67f04914586ea18695fdf758878fc174557c1.tar.gz llvm-4fc67f04914586ea18695fdf758878fc174557c1.tar.bz2 llvm-4fc67f04914586ea18695fdf758878fc174557c1.tar.xz |
[CMake] Move -ffunction-data-sections stuff to HandleLLVMOptions.
With this tweaks, also unittests are compiled with -ffunction-sections.
It's hard to control contextual CMAKE_CXX_FLAGS. We should get rid of twiddling it as possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/AddLLVM.cmake')
-rw-r--r-- | cmake/modules/AddLLVM.cmake | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 82a767862b..5bc3c22cf8 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -100,21 +100,12 @@ function(add_llvm_symbol_exports target_name export_file) endfunction(add_llvm_symbol_exports) function(add_dead_strip target_name) - # FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF? - # But MinSizeRel seems to add that automatically, so maybe disable these - # flags instead if LLVM_NO_DEAD_STRIP is set. - if(NOT CYGWIN AND NOT MINGW AND NOT MSVC) - if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - SET(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections" - PARENT_SCOPE) - endif() - endif() if(NOT LLVM_NO_DEAD_STRIP) if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-dead_strip") elseif(NOT WIN32) + # Object files are compiled with -ffunction-data-sections. set_property(TARGET ${target_name} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--gc-sections") endif() |