From d7605a4292c9dc38705adc43f39e94986aa0d060 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Fri, 3 Nov 2023 19:20:31 +0100 Subject: [PATCH 1/4] Added missing visible attributes Signed-off-by: Jose Luis Rivero --- .../joint_position_controller/JointPositionController.hh | 5 +++-- src/gui/plugins/plot_3d/Plot3D.hh | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/plugins/joint_position_controller/JointPositionController.hh b/src/gui/plugins/joint_position_controller/JointPositionController.hh index 0e23ca4bc9..6ef62ad538 100644 --- a/src/gui/plugins/joint_position_controller/JointPositionController.hh +++ b/src/gui/plugins/joint_position_controller/JointPositionController.hh @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -36,7 +37,7 @@ namespace gui class JointPositionControllerPrivate; /// \brief Model holding information about joints - class JointsModel : public QStandardItemModel + class GZ_SIM_GUI_VISIBLE JointsModel : public QStandardItemModel { Q_OBJECT @@ -88,7 +89,7 @@ namespace gui /// ``: Load the widget pointed at the given model, so it's not /// necessary to select it. If a model is given at startup, the plugin starts /// in locked mode. - class JointPositionController : public sim::GuiSystem + class GZ_SIM_GUI_VISIBLE JointPositionController : public sim::GuiSystem { Q_OBJECT diff --git a/src/gui/plugins/plot_3d/Plot3D.hh b/src/gui/plugins/plot_3d/Plot3D.hh index d3d7836e5a..103393a664 100644 --- a/src/gui/plugins/plot_3d/Plot3D.hh +++ b/src/gui/plugins/plot_3d/Plot3D.hh @@ -20,6 +20,7 @@ #include +#include #include #include "gz/gui/qt.h" @@ -59,7 +60,7 @@ namespace gui /// After this number is reached, the older points start being deleted. /// Defaults to 1000. /// - class Plot3D : public gz::sim::GuiSystem + class GZ_SIM_GUI_VISIBLE Plot3D : public gz::sim::GuiSystem { Q_OBJECT From f4ec31025611d5f88865b59cf41347aa710ab96e Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 16 Nov 2023 19:13:21 +0100 Subject: [PATCH 2/4] Enable HIDE_SYMBOLS_BY_DEFAULT Signed-off-by: Jose Luis Rivero --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac957230b7..27023d35af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,7 +235,8 @@ set(GZ_SIM_GUI_PLUGIN_INSTALL_DIR #============================================================================ # Configure the build #============================================================================ -gz_configure_build(QUIT_IF_BUILD_ERRORS) +gz_configure_build(QUIT_IF_BUILD_ERRORS + HIDE_SYMBOLS_BY_DEFAULT) add_subdirectory(examples) From 5bd0f73ad91c9a844beea7945c4cc834788ae69a Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 14 Dec 2023 19:30:50 +0100 Subject: [PATCH 3/4] Set custom plugin visibility definitions Signed-off-by: Jose Luis Rivero --- .../JointPositionController.hh | 15 ++++++++++++--- src/gui/plugins/plot_3d/Plot3D.hh | 13 +++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/gui/plugins/joint_position_controller/JointPositionController.hh b/src/gui/plugins/joint_position_controller/JointPositionController.hh index 6ef62ad538..f579bee22f 100644 --- a/src/gui/plugins/joint_position_controller/JointPositionController.hh +++ b/src/gui/plugins/joint_position_controller/JointPositionController.hh @@ -22,10 +22,19 @@ #include #include -#include #include #include +#ifndef _WIN32 +# define JointPositionController_EXPORTS_API __attribute__ ((visibility ("default"))) +#else +# if (defined(JointPositionController_EXPORTS)) +# define JointPositionController_EXPORTS_API __declspec(dllexport) +# else +# define JointPositionController_EXPORTS_API __declspec(dllimport) +# endif +#endif + Q_DECLARE_METATYPE(gz::sim::Entity) namespace gz @@ -37,7 +46,7 @@ namespace gui class JointPositionControllerPrivate; /// \brief Model holding information about joints - class GZ_SIM_GUI_VISIBLE JointsModel : public QStandardItemModel + class JointPositionController_EXPORTS_API JointsModel : public QStandardItemModel { Q_OBJECT @@ -89,7 +98,7 @@ namespace gui /// ``: Load the widget pointed at the given model, so it's not /// necessary to select it. If a model is given at startup, the plugin starts /// in locked mode. - class GZ_SIM_GUI_VISIBLE JointPositionController : public sim::GuiSystem + class JointPositionController_EXPORTS_API JointPositionController : public sim::GuiSystem { Q_OBJECT diff --git a/src/gui/plugins/plot_3d/Plot3D.hh b/src/gui/plugins/plot_3d/Plot3D.hh index 103393a664..180f68a785 100644 --- a/src/gui/plugins/plot_3d/Plot3D.hh +++ b/src/gui/plugins/plot_3d/Plot3D.hh @@ -20,11 +20,20 @@ #include -#include #include #include "gz/gui/qt.h" +#ifndef _WIN32 +# define Plot3D_EXPORTS_API __attribute__ ((visibility ("default"))) +#else +# if (defined(Plot3D_EXPORTS)) +# define Plot3D_EXPORTS_API __declspec(dllexport) +# else +# define Plot3D_EXPORTS_API __declspec(dllimport) +# endif +#endif + namespace gz { namespace sim @@ -60,7 +69,7 @@ namespace gui /// After this number is reached, the older points start being deleted. /// Defaults to 1000. /// - class GZ_SIM_GUI_VISIBLE Plot3D : public gz::sim::GuiSystem + class Plot3D_EXPORTS_API Plot3D : public gz::sim::GuiSystem { Q_OBJECT From 66cc09f15e3eaa5a5ae140ba5ee02dea9fd96f4e Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 14 Dec 2023 19:38:45 +0100 Subject: [PATCH 4/4] Make the linter happy Signed-off-by: Jose Luis Rivero --- .../joint_position_controller/JointPositionController.hh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/plugins/joint_position_controller/JointPositionController.hh b/src/gui/plugins/joint_position_controller/JointPositionController.hh index f579bee22f..172f893f65 100644 --- a/src/gui/plugins/joint_position_controller/JointPositionController.hh +++ b/src/gui/plugins/joint_position_controller/JointPositionController.hh @@ -26,7 +26,8 @@ #include #ifndef _WIN32 -# define JointPositionController_EXPORTS_API __attribute__ ((visibility ("default"))) +# define JointPositionController_EXPORTS_API \ + __attribute__ ((visibility ("default"))) #else # if (defined(JointPositionController_EXPORTS)) # define JointPositionController_EXPORTS_API __declspec(dllexport) @@ -46,7 +47,8 @@ namespace gui class JointPositionControllerPrivate; /// \brief Model holding information about joints - class JointPositionController_EXPORTS_API JointsModel : public QStandardItemModel + class JointPositionController_EXPORTS_API JointsModel : + public QStandardItemModel { Q_OBJECT @@ -98,7 +100,8 @@ namespace gui /// ``: Load the widget pointed at the given model, so it's not /// necessary to select it. If a model is given at startup, the plugin starts /// in locked mode. - class JointPositionController_EXPORTS_API JointPositionController : public sim::GuiSystem + class JointPositionController_EXPORTS_API JointPositionController : + public sim::GuiSystem { Q_OBJECT