ladybird/Ladybird/cmake/EnableLLD.cmake
2022-12-25 07:58:58 -07:00

14 lines
481 B
CMake

option(LADYBIRD_USE_LLD "Use llvm lld to link application" ON)
if (LADYBIRD_USE_LLD AND NOT APPLE)
find_program(LLD_LINKER NAMES "ld.lld")
if (NOT LLD_LINKER)
message(INFO "LLD not found, cannot use to link. Disabling option...")
set(LADYBIRD_USE_LLD OFF CACHE BOOL "" FORCE)
endif()
endif()
if (LADYBIRD_USE_LLD AND NOT APPLE)
add_link_options(-fuse-ld=lld)
add_compile_options(-ggnu-pubnames)
add_link_options(LINKER:--gdb-index)
endif()