From a4d8f83ce2c72e0563b20090c84eb8c3cecd2ed7 Mon Sep 17 00:00:00 2001 From: zhangyi1357 Date: Mon, 30 Sep 2024 15:43:02 +0800 Subject: [PATCH] build: link dl library with dynamic loading support Include the dynamic loading library to enhance compatibility when using the fmt library, ensuring that dependent components can function correctly with external resources. --- src/common/util/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/util/CMakeLists.txt b/src/common/util/CMakeLists.txt index 16cf67ddd..234dc8358 100644 --- a/src/common/util/CMakeLists.txt +++ b/src/common/util/CMakeLists.txt @@ -34,7 +34,7 @@ target_sources(${CUR_TARGET_NAME} INTERFACE FILE_SET HEADERS BASE_DIRS ${CMAKE_C # Fmt lib if(AIMRT_USE_FMT_LIB) - target_link_libraries(${CUR_TARGET_NAME} INTERFACE fmt::fmt-header-only) + target_link_libraries(${CUR_TARGET_NAME} INTERFACE fmt::fmt-header-only ${CMAKE_DL_LIBS}) target_compile_definitions(${CUR_TARGET_NAME} INTERFACE AIMRT_USE_FMT_LIB) endif()