Fix visibility in mpc_controller
Description
mpc_controller fails to build with -fvisibility=hidden
This means all symbols in the binary are available for linking rather than just the ones intended for public usage. Adding visibility control can have numerous benefits; cf. https://gcc.gnu.org/wiki/Visibility
Expected behavior
mpc_controller to use visibility_control.hpp
like many other packages to expose public symbols with compiler attributes. Then -fvisibility=hidden
hides all other symbols by default:
With -fvisibility=hidden, you are telling GCC that every declaration not explicitly marked with a visibility attribute has a hidden visibility. And like in the example above, even for classes marked as visible (exported from the DSO), you may still want to mark e.g. private members as hidden, so that optimal code will be produced when calling them (from within the DSO).
Definition of Done
-
introduce visibility control to mpc_controller to expose only public symbols -
enable autoware_set_compile_options
inCMakeLists.txt
-
add section to contributer guide to explain visibility