Use mold linker if installed on system
This commit is contained in:
parent
c8f1e52587
commit
3bdd77d77f
|
@ -5,9 +5,16 @@ set(CMAKE_CXX_STANDARD 26)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
|
||||||
add_compile_options(-fdiagnostics-color=always)
|
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")
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||||
add_compile_options(-O3 -march=native)
|
add_compile_options(-O3 -march=native)
|
||||||
|
add_link_options(-s)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
Loading…
Reference in New Issue