[YAML Parser] Depend on rcutils only (#470)

* Make rcl_yaml_param_parser depend on rcutils only.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>

* Address peer review comments.

Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
This commit is contained in:
Michel Hidalgo 2019-07-12 11:01:24 -03:00 committed by GitHub
parent 21ff57b14b
commit f9ceef5c86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 325 additions and 332 deletions

View file

@ -4,7 +4,6 @@ project(rcl_yaml_param_parser)
find_package(ament_cmake_ros REQUIRED)
find_package(rcutils REQUIRED)
find_package(rcl REQUIRED)
find_package(libyaml_vendor REQUIRED)
find_package(yaml REQUIRED)
@ -26,9 +25,18 @@ set(rcl_yaml_parser_sources
add_library(
${PROJECT_NAME}
${rcl_yaml_parser_sources})
ament_target_dependencies(${PROJECT_NAME} "yaml" "rcutils" "rcl")
ament_target_dependencies(${PROJECT_NAME} "yaml" "rcutils")
# Set the visibility to hidden by default if possible
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
# Set the visibility of symbols to hidden by default for gcc and clang
# (this is already the default on Windows)
set_target_properties(${PROJECT_NAME}
PROPERTIES
COMPILE_FLAGS "-fvisibility=hidden"
)
endif()
rcl_set_symbol_visibility_hidden(${PROJECT_NAME} LANGUAGE "C")
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME} PRIVATE "RCL_YAML_PARAM_PARSER_BUILDING_DLL")