Use mold if available as linker
continuous-integration/drone/push Build is failing Details
continuous-integration/drone Build is passing Details

This commit is contained in:
Deukhoofd 2022-05-18 17:23:19 +02:00
parent cd0e183598
commit b324cfdd00
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,12 @@ if (SHARED)
endif (SHARED) endif (SHARED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_link_options(-fuse-ld=lld) if (EXISTS /usr/bin/mold)
message(STATUS "Mold found, using as linker")
add_link_options(-fuse-ld=mold)
else()
add_link_options(-fuse-ld=lld)
endif()
# Only warn for unknown sanitizers. This error is not major enough to error on. # Only warn for unknown sanitizers. This error is not major enough to error on.
add_compile_options(-Wno-error=unknown-sanitizers -Wno-nullability-extension -Wno-gnu-zero-variadic-macro-arguments) add_compile_options(-Wno-error=unknown-sanitizers -Wno-nullability-extension -Wno-gnu-zero-variadic-macro-arguments)
# Ignore pedantic nullability extension warning, as we only use this for clang specifically # Ignore pedantic nullability extension warning, as we only use this for clang specifically