Use mold as linker if available for clang.
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build was killed Details

This commit is contained in:
Deukhoofd 2022-05-18 17:22:19 +02:00
parent 634ffce5f8
commit f4e2837b92
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 7 additions and 3 deletions

View File

@ -22,7 +22,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif ()
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.
add_compile_options(-Wno-error=unknown-sanitizers)
# Ignore pedantic nullability extension warning, as we only use this for clang specifically
@ -119,7 +124,7 @@ endif ()
if (CMAKE_BUILD_TYPE MATCHES Release AND NOT WINDOWS)
# Include debug symbols in all linux builds
message("Including debug symbols")
message(STATUS "Including debug symbols")
add_compile_options(-g -gline-tables-only)
endif ()
@ -202,7 +207,6 @@ if (SCRIPT_PROVIDER STREQUAL "angelscript")
elseif (SCRIPT_PROVIDER STREQUAL "wasm")
message(STATUS "Using WebAssembly as script provider.")
target_link_directories(pkmnLib PUBLIC $ENV{WASMER_DIR}/lib)
message($ENV{WASMER_DIR}/lib)
ADD_DEFINITIONS(-D WASM=1)
SET(_LINKS ${_LINKS} -Wl,-Bstatic wasmer -Wl,-Bdynamic)
SET(_TESTLINKS ${_TESTLINKS} -Wl,-Bstatic wasmer -Wl,-Bdynamic)