Skip to content

Commit f9ceef5

Browse files
authored
[YAML Parser] Depend on rcutils only (#470)
* Make rcl_yaml_param_parser depend on rcutils only. Signed-off-by: Michel Hidalgo <[email protected]> * Address peer review comments. Signed-off-by: Michel Hidalgo <[email protected]>
1 parent 21ff57b commit f9ceef5

File tree

4 files changed

+324
-331
lines changed

4 files changed

+324
-331
lines changed

rcl_yaml_param_parser/CMakeLists.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ project(rcl_yaml_param_parser)
44

55
find_package(ament_cmake_ros REQUIRED)
66
find_package(rcutils REQUIRED)
7-
find_package(rcl REQUIRED)
87
find_package(libyaml_vendor REQUIRED)
98
find_package(yaml REQUIRED)
109

@@ -26,9 +25,18 @@ set(rcl_yaml_parser_sources
2625
add_library(
2726
${PROJECT_NAME}
2827
${rcl_yaml_parser_sources})
29-
ament_target_dependencies(${PROJECT_NAME} "yaml" "rcutils" "rcl")
28+
ament_target_dependencies(${PROJECT_NAME} "yaml" "rcutils")
29+
30+
# Set the visibility to hidden by default if possible
31+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
32+
# Set the visibility of symbols to hidden by default for gcc and clang
33+
# (this is already the default on Windows)
34+
set_target_properties(${PROJECT_NAME}
35+
PROPERTIES
36+
COMPILE_FLAGS "-fvisibility=hidden"
37+
)
38+
endif()
3039

31-
rcl_set_symbol_visibility_hidden(${PROJECT_NAME} LANGUAGE "C")
3240
# Causes the visibility macros to use dllexport rather than dllimport,
3341
# which is appropriate when building the dll but not consuming it.
3442
target_compile_definitions(${PROJECT_NAME} PRIVATE "RCL_YAML_PARAM_PARSER_BUILDING_DLL")

rcl_yaml_param_parser/include/rcl_yaml_param_parser/types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#ifndef RCL_YAML_PARAM_PARSER__TYPES_H_
1515
#define RCL_YAML_PARAM_PARSER__TYPES_H_
1616

17-
#include "rcl/allocator.h"
17+
#include "rcutils/allocator.h"
1818
#include "rcutils/types/string_array.h"
1919

2020
/// \typedef rcl_bool_array_t
@@ -81,7 +81,7 @@ typedef struct rcl_params_s
8181
char ** node_names; ///< List of names of the node
8282
rcl_node_params_t * params; ///< Array of parameters
8383
size_t num_nodes; ///< Number of nodes
84-
rcl_allocator_t allocator; ///< Allocator used
84+
rcutils_allocator_t allocator; ///< Allocator used
8585
} rcl_params_t;
8686

8787
#endif // RCL_YAML_PARAM_PARSER__TYPES_H_

rcl_yaml_param_parser/package.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<depend>libyaml_vendor</depend>
1313
<depend>yaml</depend>
1414
<build_depend>rcutils</build_depend>
15-
<build_depend>rcl</build_depend>
1615

1716
<test_depend>ament_cmake_gtest</test_depend>
1817
<test_depend>ament_lint_common</test_depend>

0 commit comments

Comments
 (0)