-
Notifications
You must be signed in to change notification settings - Fork 142
Description
On Windows, Microsoft C/C++ compiler comes with a concept of dllexport and dllimport. In order to make a DLL library header able to be consumed by the downstream project, the function, class, or data declaration needs to be decorated with the correct attributes.
CMake provides CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS and attempts to fix the problem less intrusive to the existing code base. However, it still comes with limitation, for example, it doesn't support static member, and it will bloat the size of the generated imported library because it exhaustively exposes whatever it can do.
In ROS1, I explored a way to enable dllexport and dllimport for a catkin-based project. Here is the pull request for rviz to show the example. This change makes use of generate_export_header and with some careful steps to stage and install it to a place to be consumed within and across catkin packages.
I would like to use this ticket to discuss:
- Any feedback on the
generate_export_headerapproach? - Would it make sense to make it part of
ament_cmakerequirements or should it be just step-by-step guidance in theament_cmake User Documentation.