From f421e6ceffd6f436ae8138ec6334f527f8b2d44d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 09:50:41 +0200 Subject: [PATCH] Don't link dl library when not needed (#28) (#30) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 55de2e1fe0ff3da9b882dfee6a54516e54bd58a9) Co-authored-by: Błażej Sowa --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ec9265b..2e7c85e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,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)