From fbdc8874ee7457a4a9463e08880de34f6d05e3bd Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Mon, 13 Nov 2023 17:53:13 +0100 Subject: [PATCH] Enable HIDE_SYMBOLS_BY_DEFAULT Use GZ_ visibilty macro instead of custom _EXPORTS_API to fix problems on Linux --- CMakeLists.txt | 3 ++- src/PointCloudUtil.hh | 12 +----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c82c166..58b97a12 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,8 @@ find_package(Eigen3 REQUIRED) #============================================================================ # Configure the build #============================================================================ -gz_configure_build(QUIT_IF_BUILD_ERRORS) +gz_configure_build(QUIT_IF_BUILD_ERRORS + HIDE_SYMBOLS_BY_DEFAULT) #============================================================================ # Create package information diff --git a/src/PointCloudUtil.hh b/src/PointCloudUtil.hh index ca4e30ae..12a95460 100644 --- a/src/PointCloudUtil.hh +++ b/src/PointCloudUtil.hh @@ -32,16 +32,6 @@ #include "gz/sensors/config.hh" #include "gz/sensors/Export.hh" -#ifndef _WIN32 -# define PointCloudUtil_EXPORTS_API -#else -# if (defined(DepthPoints_EXPORTS)) -# define PointCloudUtil_EXPORTS_API __declspec(dllexport) -# else -# define PointCloudUtil_EXPORTS_API __declspec(dllimport) -# endif -#endif - namespace gz { namespace sensors @@ -52,7 +42,7 @@ namespace gz /// \brief Helper class that fills a msgs::PointCloudPacked message using /// image and depth data. The RgbdCameraSensor and DepthCameraSensor /// class use this. - class PointCloudUtil_EXPORTS_API PointCloudUtil + class GZ_SENSORS_VISIBLE PointCloudUtil { /// \brief Fill a msgs::PointCloudPacked. /// \param[in,out] _msg Point cloud message to fill. This message