From a8e04704f930de168fdddbb1c040dd70fbbe8ff7 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Sat, 30 Nov 2024 00:05:08 +0100 Subject: [PATCH] build: Set shared linker flags in toolchain file These are required when cross-compiling shared libraries such as the kernel library. --- depends/toolchain.cmake.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in index 69ff3cfb74..e72e6e29e2 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -55,12 +55,21 @@ set(DEPENDS_COMPILE_DEFINITIONS_DEBUG @CPPFLAGS_DEBUG@) if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) set(CMAKE_EXE_LINKER_FLAGS_INIT "@LDFLAGS@") endif() +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_INIT) + set(CMAKE_SHARED_LINKER_FLAGS_INIT "@LDFLAGS@") +endif() if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT) set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@") endif() +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT) + set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@") +endif() if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT) set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@") endif() +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT) + set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@") +endif() set(CMAKE_AR "@AR@") set(CMAKE_RANLIB "@RANLIB@")