mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 03:35:55 +00:00
chore: Use mold when available without option (#2521)
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
if (use_mold)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(STATUS "Using Mold linker")
|
||||
set(CMAKE_LINKER_TYPE MOLD)
|
||||
else ()
|
||||
message(FATAL_ERROR "Mold linker is only supported on Linux.")
|
||||
endif ()
|
||||
if (DEFINED CMAKE_LINKER_TYPE)
|
||||
message(STATUS "Custom linker is already set: ${CMAKE_LINKER_TYPE}")
|
||||
return()
|
||||
endif ()
|
||||
|
||||
find_program(MOLD_PATH mold)
|
||||
|
||||
if (MOLD_PATH AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
message(STATUS "Using Mold linker: ${MOLD_PATH}")
|
||||
set(CMAKE_LINKER_TYPE MOLD)
|
||||
endif ()
|
||||
|
||||
Reference in New Issue
Block a user