From 52512006ca088c2af6128f494464df532aad6ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C5=82a=C5=BCej=20Sowa?= Date: Tue, 8 Jul 2025 15:12:00 +0200 Subject: [PATCH] Don't export dl library when not used (#33) (cherry picked from commit 1f5e5f1d192914013a381fc458390b20461335a4) --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 93aeebab..084e1ebf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -616,7 +616,10 @@ endif() # Export old-style CMake variables ament_export_include_directories("include/${PROJECT_NAME}") -ament_export_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS}) + +if(NOT RCUTILS_NO_FILESYSTEM) + ament_export_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS}) +endif() # Export modern CMake targets ament_export_targets(${PROJECT_NAME})