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.
This commit is contained in:
zhangyi1357 2024-09-30 15:43:02 +08:00
parent 78c7428165
commit a4d8f83ce2

View File

@ -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()