Use mold as linker if available for clang.
This commit is contained in:
parent
634ffce5f8
commit
f4e2837b92
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue