From 2b2db9c8a24287706a8f27f5d955bc79d58b2ff4 Mon Sep 17 00:00:00 2001
From: Steve Peters <scpeters@openrobotics.org>
Date: Thu, 16 Nov 2023 15:15:36 -0800
Subject: [PATCH] Use HIDE_SYMBOLS_BY_DEFAULT (#576)

Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
Co-authored-by: Jose Luis Rivero <jrivero@osrfoundation.org>
---
 CMakeLists.txt                          | 1 +
 dartsim/src/EntityManagementFeatures.hh | 4 +++-
 dartsim/src/SDFFeatures.hh              | 4 +++-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa12b970f..99f0f4e0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,6 +104,7 @@ set(GZ_PHYSICS_ENGINE_INSTALL_DIR
 # Configure the build
 #============================================================================
 gz_configure_build(QUIT_IF_BUILD_ERRORS
+  HIDE_SYMBOLS_BY_DEFAULT
   COMPONENTS sdf heightmap mesh dartsim tpe bullet bullet-featherstone)
 
 
diff --git a/dartsim/src/EntityManagementFeatures.hh b/dartsim/src/EntityManagementFeatures.hh
index 10d6bb41f..fdb485e27 100644
--- a/dartsim/src/EntityManagementFeatures.hh
+++ b/dartsim/src/EntityManagementFeatures.hh
@@ -20,6 +20,8 @@
 
 #include <string>
 
+#include <gz/physics/dartsim-plugin/Export.hh>
+
 #include <gz/physics/ConstructEmpty.hh>
 #include <gz/physics/Shape.hh>
 #include <gz/physics/GetEntities.hh>
@@ -43,7 +45,7 @@ struct EntityManagementFeatureList : FeatureList<
   WorldModelFeature
 > { };
 
-class EntityManagementFeatures :
+class GZ_PHYSICS_DARTSIM_PLUGIN_VISIBLE EntityManagementFeatures :
     public virtual Base,
     public virtual Implements3d<EntityManagementFeatureList>
 {
diff --git a/dartsim/src/SDFFeatures.hh b/dartsim/src/SDFFeatures.hh
index 11c9bab33..f171c2939 100644
--- a/dartsim/src/SDFFeatures.hh
+++ b/dartsim/src/SDFFeatures.hh
@@ -22,6 +22,8 @@
 #include <string>
 #include <utility>
 
+#include <gz/physics/dartsim-plugin/Export.hh>
+
 #include <gz/physics/sdf/ConstructCollision.hh>
 #include <gz/physics/sdf/ConstructJoint.hh>
 #include <gz/physics/sdf/ConstructLink.hh>
@@ -50,7 +52,7 @@ struct SDFFeatureList : FeatureList<
   sdf::ConstructSdfVisual
 > { };
 
-class SDFFeatures :
+class GZ_PHYSICS_DARTSIM_PLUGIN_VISIBLE SDFFeatures :
     public virtual EntityManagementFeatures,
     public virtual Implements3d<SDFFeatureList>
 {