CMake: fix possible linking errors in BINARY_LINK_TYPE=dynamic mode

This commit is contained in:
李通洲
2024-11-20 22:13:10 +08:00
parent a567268ca1
commit 71b073e1bf
+3
View File
@@ -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)