From 4c424b9290e9953e709960def4bb42dcaedd3eaf Mon Sep 17 00:00:00 2001
From: Daniel Golle <daniel@makrotopia.org>
Date: Thu, 5 Feb 2026 01:55:02 +0000
Subject: [PATCH] build: fix external project builds with LTO-enabled
 toolchains

* build: propagate LTO-aware archiver tools (CMAKE_AR, CMAKE_NM, CMAKE_RANLIB) to external projects

https://github.com/transmission/transmission/pull/8369
---
 cmake/TrMacros.cmake | 3 +++
 1 file changed, 3 insertions(+)

--- a/cmake/TrMacros.cmake
+++ b/cmake/TrMacros.cmake
@@ -197,6 +197,9 @@ macro(tr_add_external_auto_library ID DI
                 "-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}"
                 "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
                 "-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}"
+                "-DCMAKE_AR=${CMAKE_AR}"
+                "-DCMAKE_NM=${CMAKE_NM}"
+                "-DCMAKE_RANLIB=${CMAKE_RANLIB}"
                 "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
                 "-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>"
                 "-DCMAKE_INSTALL_LIBDIR:STRING=lib"
