mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 10:00:16 +02:00
See https://github.com/FEX-Emu/FEX/pull/5172#pullrequestreview-3626560058. Signed-off-by: crueter <crueter@eden-emu.dev>
16 lines
624 B
CMake
16 lines
624 B
CMake
# SPDX-License-Identifier: MIT
|
|
|
|
# This applies some common linker options that reduce code size and linking time in Release mode. Namely:
|
|
# --gc-sections: Linktime garbage collection, discards unused sections from the final output
|
|
# --strip-all : Similar to running `strip`, discards the symbol table from the final output
|
|
# --as-needed : Only includes libraries that are actually needed in the final output.
|
|
|
|
macro(LinkerGC target)
|
|
if (CMAKE_BUILD_TYPE MATCHES "RELEASE")
|
|
target_link_options(${target} PRIVATE
|
|
"LINKER:--gc-sections"
|
|
"LINKER:--strip-all"
|
|
"LINKER:--as-needed")
|
|
endif()
|
|
endmacro()
|