From 99e1bbf423f085e34b0e7a354e3e9ec9ff54dae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 30 Dec 2021 16:55:17 +0100 Subject: [PATCH] Add support for using custom linker (e.g. mold) --- toolchain/ToolchainNX64.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/toolchain/ToolchainNX64.cmake b/toolchain/ToolchainNX64.cmake index 247e82e3..cbf6f119 100644 --- a/toolchain/ToolchainNX64.cmake +++ b/toolchain/ToolchainNX64.cmake @@ -38,5 +38,10 @@ add_definitions(-D MATCHING_HACK_NX_CLANG) add_link_options(-stdlib=libc++ -nostdlib) add_link_options(-fPIC -Wl,-Bsymbolic-functions -shared) -# Use lld for performance reasons (and because we don't want a dependency on GNU tools) -add_link_options(-fuse-ld=lld) +if (DEFINED UKING_LINKER) + message(STATUS "Using custom linker: ${UKING_LINKER}") + add_link_options(-fuse-ld=${UKING_LINKER}) +else() + # Use lld for performance reasons (and because we don't want a dependency on GNU tools) + add_link_options(-fuse-ld=lld) +endif()