From 71b073e1bf987340dcf2cb13eb2537297ee9cb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 20 Nov 2024 22:13:10 +0800 Subject: [PATCH] CMake: fix possible linking errors in `BINARY_LINK_TYPE=dynamic` mode --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c6eed1c4..d6fa6c3aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1220,6 +1220,9 @@ endif() if(NOT BINARY_LINK_TYPE STREQUAL "dlopen") message(STATUS "Enabling custom link type: ${BINARY_LINK_TYPE}") target_compile_definitions(libfastfetch PRIVATE FF_DISABLE_DLOPEN=1) + if(NOT WIN32) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--copy-dt-needed-entries") + endif() endif() function(ff_lib_enable VARNAME PKGCONFIG_NAMES CMAKE_NAME)