1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

Meta: Link Lagom with LLD by default and allow configuring the linker

This ports over the `LADYBIRD_USE_LLD` option from the standalone
Ladybird build and generalizes it to work for mold as well: the
`LAGOM_USE_LINKER` variable can be set to the desired name of the
linker. If it's empty, we default to trying LLD and Mold on ELF
platforms (in this order).
This commit is contained in:
Daniel Bertalan 2023-09-05 07:40:57 +02:00 committed by Andreas Kling
parent 07039af982
commit dac443fbff
6 changed files with 46 additions and 23 deletions

View file

@ -4,7 +4,19 @@ add_compile_options(-Wno-maybe-uninitialized)
add_compile_options(-Wno-shorten-64-to-32)
add_compile_options(-fsigned-char)
add_compile_options(-g1)
add_compile_options(-ggnu-pubnames)
add_compile_options(-O2)
if (NOT WIN32)
add_compile_options(-fPIC)
endif()
function(add_linker_flag_if_supported flag)
include(CheckLinkerFlag)
check_linker_flag(CXX ${flag} LAGOM_LINKER_SUPPORTS_${flag})
if (${LAGOM_LINKER_SUPPORTS_${flag}})
add_link_options(${flag})
endif()
endfunction()
add_linker_flag_if_supported(LINKER:--gdb-index)