mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
[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
This commit is contained in:
@@ -349,3 +349,13 @@ if (UNIX AND
|
||||
CMAKE_GENERATOR STREQUAL "Ninja")
|
||||
append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
|
||||
# Add flags for add_dead_strip().
|
||||
# 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 WIN32)
|
||||
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
append("-ffunction-sections -fdata-sections" CMAKE_CXX_FLAGS)
|
||||
endif()
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user