Use mold linker if installed on system

This commit is contained in:
:^) 2024-11-10 21:58:51 +01:00
parent c8f1e52587
commit 3bdd77d77f
No known key found for this signature in database
2 changed files with 7 additions and 0 deletions

View File

@ -5,9 +5,16 @@ set(CMAKE_CXX_STANDARD 26)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
add_compile_options(-fdiagnostics-color=always)
find_program(MOLD_LINKER mold)
if (MOLD_LINKER)
add_link_options(-fuse-ld=mold)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
add_compile_options(-O3 -march=native)
add_link_options(-s)
endif()
include(FetchContent)

View File