Set symbol visibility to hidden for rcl (#391)

* Set symbol visibility to hidden for rcl

Enabling symbol visibility feature in gcc and clang compilers.
This will hep find symbol export related issues in linux and
potentially reduce compile times.

Discourse topic link:
https://discourse.ros.org/t/set-symbol-visibility-to-hidden-for-rmw-and-rcl-packages/7981

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Remove WIN specific compiler definition in configure_rcl

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Rename macro name rcl_set_symbol_visibility_hidden

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>

* Change macro to args for rcl_set_symbol_visibility_hidden

Signed-off-by: Sachin Suresh Bhat <bhatsach@amazon.com>
This commit is contained in:
Sachin Suresh Bhat 2019-03-05 18:09:55 -08:00 committed by William Woodall
parent b5cdc496d0
commit 2ff5df0c11
6 changed files with 93 additions and 2 deletions

View file

@ -28,6 +28,7 @@ add_library(
${rcl_yaml_parser_sources})
ament_target_dependencies(${PROJECT_NAME} "yaml" "rcutils" "rcl")
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")