summaryrefslogtreecommitdiff
path: root/indra/cmake/Linker.cmake
diff options
context:
space:
mode:
authorBennett Goble <signal@lindenlab.com>2024-04-10 19:54:10 -0700
committerBennett Goble <signal@lindenlab.com>2024-04-10 20:52:53 -0700
commit148f80f0779f42c1aa7d2f07c04a63507446662c (patch)
tree97e23835ebc467603faa15342db0cee7681499b5 /indra/cmake/Linker.cmake
parent72730609f371ae0417a2d117fdc9d805ce8858fb (diff)
Linux: build with clang, link with mold
Diffstat (limited to 'indra/cmake/Linker.cmake')
-rw-r--r--indra/cmake/Linker.cmake11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/cmake/Linker.cmake b/indra/cmake/Linker.cmake
new file mode 100644
index 0000000000..292aa25c57
--- /dev/null
+++ b/indra/cmake/Linker.cmake
@@ -0,0 +1,11 @@
+include_guard(GLOBAL)
+
+if (${LINK_WITH_MOLD})
+ find_program(MOLD_BIN mold REQUIRED)
+ if(MOLD_BIN)
+ message(STATUS "Mold linker found: ${MOLD_BIN}. Enabling mold as active linker.")
+ add_link_options("-fuse-ld=${MOLD_BIN}")
+ else()
+ message(STATUS "Mold linker not found. Using default linker.")
+ endif()
+endif()