From ce0e472072e48d689a1561a571778c630e7f6163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Mon, 17 Jul 2023 09:50:03 +0200 Subject: [PATCH] Don't link dl library when not needed (#28) --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33242e52..49f07928 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,7 +142,9 @@ configure_file( "${PROJECT_BINARY_DIR}/include/rcutils/configuration_flags.h" ) -target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS}) +if(NOT RCUTILS_NO_FILESYSTEM) + target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS}) +endif() # Needed if pthread is used for thread local storage. if(IOS AND IOS_SDK_VERSION LESS 10.0)