From e9ba573159e18569610d7c42ce2488259316d55a Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Fri, 15 Jan 2021 18:41:48 +0100 Subject: [PATCH 1/8] Remove invalid visibility macros Signed-off-by: Jose Luis Rivero --- include/ignition/gazebo/System.hh | 14 +++++++------- include/ignition/gazebo/components/Factory.hh | 12 ++++++------ src/cmd/ign.cc | 12 ++++++------ src/ign.cc | 14 +++++++------- src/ign.hh | 14 +++++++------- test/plugins/EventTriggerSystem.hh | 3 ++- test/plugins/MockSystem.hh | 4 +++- test/plugins/Null.hh | 2 +- 8 files changed, 39 insertions(+), 36 deletions(-) diff --git a/include/ignition/gazebo/System.hh b/include/ignition/gazebo/System.hh index fc2a3403c1..49cb510640 100644 --- a/include/ignition/gazebo/System.hh +++ b/include/ignition/gazebo/System.hh @@ -59,13 +59,13 @@ namespace ignition /// * Executed with simulation time at (t0 + dt) /// * Used to read out results at the end of a simulation step to be used /// for sensor or controller updates. - class IGNITION_GAZEBO_VISIBLE System + class System { /// \brief Constructor - public: System(); + public: System() = default; /// \brief Destructor - public: virtual ~System(); + public: virtual ~System() = default; }; /// \class ISystemConfigure ISystem.hh ignition/gazebo/System.hh @@ -74,7 +74,7 @@ namespace ignition /// Configure is called after the system is instatiated and all entities /// and components are loaded from the corresponding SDF world, and before /// simulation begins exectution. - class IGNITION_GAZEBO_VISIBLE ISystemConfigure { + class ISystemConfigure { /// \brief Configure the system /// \param[in] _entity The entity this plugin is attached to. /// \param[in] _sdf The SDF Element associated with this system plugin. @@ -91,21 +91,21 @@ namespace ignition /// \class ISystemPreUpdate ISystem.hh ignition/gazebo/System.hh /// \brief Interface for a system that uses the PreUpdate phase - class IGNITION_GAZEBO_VISIBLE ISystemPreUpdate { + class ISystemPreUpdate { public: virtual void PreUpdate(const UpdateInfo &_info, EntityComponentManager &_ecm) = 0; }; /// \class ISystemUpdate ISystem.hh ignition/gazebo/System.hh /// \brief Interface for a system that uses the Update phase - class IGNITION_GAZEBO_VISIBLE ISystemUpdate { + class ISystemUpdate { public: virtual void Update(const UpdateInfo &_info, EntityComponentManager &_ecm) = 0; }; /// \class ISystemPostUpdate ISystem.hh ignition/gazebo/System.hh /// \brief Interface for a system that uses the PostUpdate phase - class IGNITION_GAZEBO_VISIBLE ISystemPostUpdate{ + class ISystemPostUpdate{ public: virtual void PostUpdate(const UpdateInfo &_info, const EntityComponentManager &_ecm) = 0; }; diff --git a/include/ignition/gazebo/components/Factory.hh b/include/ignition/gazebo/components/Factory.hh index 490d18e813..d26ee7f965 100644 --- a/include/ignition/gazebo/components/Factory.hh +++ b/include/ignition/gazebo/components/Factory.hh @@ -41,7 +41,7 @@ inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE { namespace components { /// \brief A base class for an object responsible for creating components. - class IGNITION_GAZEBO_VISIBLE ComponentDescriptorBase + class ComponentDescriptorBase { /// \brief Destructor public: virtual ~ComponentDescriptorBase() = default; @@ -54,7 +54,7 @@ namespace components /// \brief A class for an object responsible for creating components. /// \tparam ComponentTypeT type of component to describe. template - class IGNITION_GAZEBO_VISIBLE ComponentDescriptor + class ComponentDescriptor : public ComponentDescriptorBase { /// \brief Create an instance of a ComponentTypeT Component. @@ -66,7 +66,7 @@ namespace components }; /// \brief A base class for an object responsible for creating storages. - class IGNITION_GAZEBO_VISIBLE StorageDescriptorBase + class StorageDescriptorBase { /// \brief Destructor public: virtual ~StorageDescriptorBase() = default; @@ -79,7 +79,7 @@ namespace components /// \brief A class for an object responsible for creating storages. /// \tparam ComponentTypeT type of component that the storage will hold. template - class IGNITION_GAZEBO_VISIBLE StorageDescriptor + class StorageDescriptor : public StorageDescriptorBase { /// \brief Create an instance of a storage that holds ComponentTypeT @@ -92,7 +92,7 @@ namespace components }; /// \brief A factory that generates a component based on a string type. - class IGNITION_GAZEBO_VISIBLE Factory + class Factory : public ignition::common::SingletonT { /// \brief Register a component so that the factory can create instances @@ -329,7 +329,7 @@ namespace components /// \param[in] _compType Component type name. /// \param[in] _classname Class name for component. #define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname) \ - class IGNITION_GAZEBO_VISIBLE IgnGazeboComponents##_classname \ + class IgnGazeboComponents##_classname \ { \ public: IgnGazeboComponents##_classname() \ { \ diff --git a/src/cmd/ign.cc b/src/cmd/ign.cc index a4a58c129b..720188a30d 100644 --- a/src/cmd/ign.cc +++ b/src/cmd/ign.cc @@ -32,32 +32,32 @@ #include "ign.hh" ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE char *ignitionGazeboVersion() +extern "C" char *ignitionGazeboVersion() { return strdup(IGNITION_GAZEBO_VERSION_FULL); } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE char *gazeboVersionHeader() +extern "C" char *gazeboVersionHeader() { return strdup(IGNITION_GAZEBO_VERSION_HEADER); } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE void cmdVerbosity( +extern "C" void cmdVerbosity( const char *_verbosity) { ignition::common::Console::SetVerbosity(std::atoi(_verbosity)); } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir() +extern "C" const char *worldInstallDir() { return IGN_GAZEBO_WORLD_INSTALL_DIR; } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString, +extern "C" int runServer(const char *_sdfString, int _iterations, int _run, float _hz, int _levels, const char *_networkRole, int _networkSecondaries, int _record, const char *_recordPath, int _logOverwrite, const char *_playback, const char *_file) @@ -206,7 +206,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString, } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE int runGui(const char *_guiConfig) +extern "C" int runGui(const char *_guiConfig) { ignition::common::SignalHandler sigHandler; bool sigKilled = false; diff --git a/src/ign.cc b/src/ign.cc index 09bb0dbf8a..9faf652e09 100644 --- a/src/ign.cc +++ b/src/ign.cc @@ -35,32 +35,32 @@ #include "ignition/gazebo/gui/Gui.hh" ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE char *ignitionGazeboVersion() +extern "C" char *ignitionGazeboVersion() { return strdup(IGNITION_GAZEBO_VERSION_FULL); } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE char *gazeboVersionHeader() +extern "C" char *gazeboVersionHeader() { return strdup(IGNITION_GAZEBO_VERSION_HEADER); } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE void cmdVerbosity( +extern "C" void cmdVerbosity( const char *_verbosity) { ignition::common::Console::SetVerbosity(std::atoi(_verbosity)); } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir() +extern "C" const char *worldInstallDir() { return IGN_GAZEBO_WORLD_INSTALL_DIR; } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE const char *findFuelResource( +extern "C" const char *findFuelResource( char *_pathToResource) { std::string path; @@ -115,7 +115,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE const char *findFuelResource( } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString, +extern "C" int runServer(const char *_sdfString, int _iterations, int _run, float _hz, int _levels, const char *_networkRole, int _networkSecondaries, int _record, const char *_recordPath, int _recordResources, int _logOverwrite, int _logCompress, @@ -355,7 +355,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString, } ////////////////////////////////////////////////// -extern "C" IGNITION_GAZEBO_VISIBLE int runGui(const char *_guiConfig) +extern "C" int runGui(const char *_guiConfig) { // argc and argv are going to be passed to a QApplication. The Qt // documentation has a warning about these: diff --git a/src/ign.hh b/src/ign.hh index 9f8aeca3dc..3b7cd3c5e4 100644 --- a/src/ign.hh +++ b/src/ign.hh @@ -21,18 +21,18 @@ /// \brief External hook to read the library version. /// \return C-string representing the version. Ex.: 0.1.2 -extern "C" IGNITION_GAZEBO_VISIBLE char *ignitionGazeboVersion(); +extern "C" char *ignitionGazeboVersion(); /// \brief Get the Gazebo version header. /// \return C-string containing the Gazebo version information. -extern "C" IGNITION_GAZEBO_VISIBLE char *gazeboVersionHeader(); +extern "C" char *gazeboVersionHeader(); /// \brief Set verbosity level /// \param[in] _verbosity 0 to 4 -extern "C" IGNITION_GAZEBO_VISIBLE void cmdVerbosity( +extern "C" void cmdVerbosity( const char *_verbosity); -extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir(); +extern "C" const char *worldInstallDir(); /// \brief External hook to run simulation server. /// \param[in] _sdfString SDF file to run, as a string. @@ -55,7 +55,7 @@ extern "C" IGNITION_GAZEBO_VISIBLE const char *worldInstallDir(); /// \param[in] _recordTopics Colon separated list of topics to record. Leave /// null to record the default topics. /// \return 0 if successful, 1 if not. -extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString, +extern "C" int runServer(const char *_sdfString, int _iterations, int _run, float _hz, int _levels, const char *_networkRole, int _networkSecondaries, int _record, const char *_recordPath, int _recordResources, int _logOverwrite, @@ -67,13 +67,13 @@ extern "C" IGNITION_GAZEBO_VISIBLE int runServer(const char *_sdfString, /// \brief External hook to run simulation GUI. /// \param[in] _guiConfig Path to Ignition GUI configuration file. /// \return 0 if successful, 1 if not. -extern "C" IGNITION_GAZEBO_VISIBLE int runGui(const char *_guiConfig); +extern "C" int runGui(const char *_guiConfig); /// \brief External hook to find or download a fuel world provided a URL. /// \param[in] _pathToResource Path to the fuel world resource, ie, /// https://staging-fuel.ignitionrobotics.org/1.0/gmas/worlds/ShapesClone /// \return C-string containing the path to the local world sdf file -extern "C" IGNITION_GAZEBO_VISIBLE const char *findFuelResource( +extern "C" const char *findFuelResource( char *_pathToResource); #endif diff --git a/test/plugins/EventTriggerSystem.hh b/test/plugins/EventTriggerSystem.hh index 4ad37f592c..5265b03d8a 100644 --- a/test/plugins/EventTriggerSystem.hh +++ b/test/plugins/EventTriggerSystem.hh @@ -25,13 +25,14 @@ namespace ignition { namespace gazebo { -class IGNITION_GAZEBO_VISIBLE EventTriggerSystem : +class EventTriggerSystem : public gazebo::System, public gazebo::ISystemConfigure, public gazebo::ISystemUpdate { // needed for linter public: EventTriggerSystem() = default; + public: ~EventTriggerSystem() = default; public: void Configure(const Entity &/*_entity*/, const std::shared_ptr &/*_sdf*/, diff --git a/test/plugins/MockSystem.hh b/test/plugins/MockSystem.hh index fee1048f3f..f8a61e893a 100644 --- a/test/plugins/MockSystem.hh +++ b/test/plugins/MockSystem.hh @@ -23,12 +23,14 @@ namespace ignition { namespace gazebo { - class IGNITION_GAZEBO_VISIBLE MockSystem : + class MockSystem : public gazebo::System, public gazebo::ISystemPreUpdate, public gazebo::ISystemUpdate, public gazebo::ISystemPostUpdate { + public: MockSystem() = default; + public: ~MockSystem() = default; public: size_t preUpdateCallCount {0}; public: size_t updateCallCount {0}; public: size_t postUpdateCallCount {0}; diff --git a/test/plugins/Null.hh b/test/plugins/Null.hh index d26f2dcd40..f0ed87d56d 100644 --- a/test/plugins/Null.hh +++ b/test/plugins/Null.hh @@ -33,7 +33,7 @@ namespace systems { /// \class Null Null.hh ignition/gazebo/systems/Null.hh /// \brief Minimal system implementation - class IGNITION_GAZEBO_VISIBLE Null: + class Null: public System, public ISystemConfigure, public ISystemPreUpdate, From 84f1d31abe9a5cb2247e438d0eee5ae78e08ea76 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 21 Jan 2021 15:49:47 +0100 Subject: [PATCH 2/8] Change system to be a header only file Signed-off-by: Jose Luis Rivero --- src/CMakeLists.txt | 1 - src/System.cc | 25 ------------------------- 2 files changed, 26 deletions(-) delete mode 100644 src/System.cc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1c029e2900..983c764e17 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,7 +52,6 @@ set (sources ServerConfig.cc ServerPrivate.cc SimulationRunner.cc - System.cc SystemLoader.cc Util.cc View.cc diff --git a/src/System.cc b/src/System.cc deleted file mode 100644 index 318e3d431d..0000000000 --- a/src/System.cc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (C) 2018 Open Source Robotics Foundation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * -*/ -#include "ignition/gazebo/System.hh" - -using namespace ignition::gazebo; - -////////////////////////////////////////////////// -System::System() = default; - -////////////////////////////////////////////////// -System::~System() = default; From 3b23e54d98934981004ec6ed727bf9f44ba0e34b Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 27 Jan 2021 14:55:38 +0100 Subject: [PATCH 3/8] Final Windows fixes to compile the software and test suite Signed-off-by: Jose Luis Rivero --- include/ignition/gazebo/EventManager.hh | 4 ++++ include/ignition/gazebo/gui/GuiSystem.hh | 6 +----- include/ignition/gazebo/gui/TmpIface.hh | 2 +- src/gui/CMakeLists.txt | 1 + src/systems/CMakeLists.txt | 11 +++++++++++ .../camera_video_recorder/CameraVideoRecorder.hh | 3 +-- .../kinetic_energy_monitor/KineticEnergyMonitor.hh | 2 +- .../logical_audio_sensor_plugin/LogicalAudio.hh | 7 +++++++ test/integration/examples_build.cc | 1 - test/integration/save_world.cc | 1 + test/plugins/CMakeLists.txt | 10 +++++++++- 11 files changed, 37 insertions(+), 11 deletions(-) diff --git a/include/ignition/gazebo/EventManager.hh b/include/ignition/gazebo/EventManager.hh index 0241bae447..bd1331cfbc 100644 --- a/include/ignition/gazebo/EventManager.hh +++ b/include/ignition/gazebo/EventManager.hh @@ -47,6 +47,10 @@ namespace ignition /// occur. /// /// See \ref ignition::gazebo::events for a complete list of events. + + /// TODO: if visibility is added here the MSVC is unable to compile it. + /// The use of smart pointer inside the unordered_map (events method) is + /// the cause of it. Maybe a compiler bug? class EventManager { /// \brief Constructor diff --git a/include/ignition/gazebo/gui/GuiSystem.hh b/include/ignition/gazebo/gui/GuiSystem.hh index 16ecdd1e09..0218f47351 100644 --- a/include/ignition/gazebo/gui/GuiSystem.hh +++ b/include/ignition/gazebo/gui/GuiSystem.hh @@ -17,11 +17,9 @@ #ifndef IGNITION_GAZEBO_GUI_GUISYSTEM_HH_ #define IGNITION_GAZEBO_GUI_GUISYSTEM_HH_ -#include - #include #include -#include +#include #include #include @@ -43,8 +41,6 @@ namespace gazebo /// separate process that is stepped by updates coming through the network class GuiSystem : public ignition::gui::Plugin { - Q_OBJECT - /// \brief Update callback called every time the system is stepped. /// This is called at an Ignition transport thread, so any interaction /// with Qt should be done through signals and slots. diff --git a/include/ignition/gazebo/gui/TmpIface.hh b/include/ignition/gazebo/gui/TmpIface.hh index 079b2946a5..c0dab6dcb5 100644 --- a/include/ignition/gazebo/gui/TmpIface.hh +++ b/include/ignition/gazebo/gui/TmpIface.hh @@ -24,7 +24,7 @@ #include #include -#include "ignition/gazebo/Export.hh" +#include "ignition/gazebo/gui/Export.hh" namespace ignition { diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 5d53622322..2cec87fd48 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -33,6 +33,7 @@ ign_add_component(gui target_link_libraries(${gui_target} PUBLIC + ${PROJECT_LIBRARY_TARGET_NAME} ignition-common${IGN_COMMON_VER}::ignition-common${IGN_COMMON_VER} ignition-gui${IGN_GUI_VER}::ignition-gui${IGN_GUI_VER} ignition-transport${IGN_TRANSPORT_VER}::ignition-transport${IGN_TRANSPORT_VER} diff --git a/src/systems/CMakeLists.txt b/src/systems/CMakeLists.txt index 1427a96125..b1cedf8414 100644 --- a/src/systems/CMakeLists.txt +++ b/src/systems/CMakeLists.txt @@ -33,6 +33,17 @@ function(gz_add_system system_name) set(system_name ${system_name}-system) + + if (MSVC) + # Warning #4251 is the "dll-interface" warning that tells you when types used + # by a class are not being exported. These generated source files have private + # members that don't get exported, so they trigger this warning. However, the + # warning is not important since those members do not need to be interfaced + # with. + set_source_files_properties(${sources} COMPILE_FLAGS "/wd4251 /wd4146") + endif() + + ign_add_component(${system_name} SOURCES ${sources} GET_TARGET_NAME system_target diff --git a/src/systems/camera_video_recorder/CameraVideoRecorder.hh b/src/systems/camera_video_recorder/CameraVideoRecorder.hh index 89dc5ac53b..a7204e5a80 100644 --- a/src/systems/camera_video_recorder/CameraVideoRecorder.hh +++ b/src/systems/camera_video_recorder/CameraVideoRecorder.hh @@ -40,8 +40,7 @@ namespace systems /// not specified, the topic defaults to: /// /world//link// /// sensor//record_video - class - CameraVideoRecorder: + class CameraVideoRecorder: public System, public ISystemConfigure, public ISystemPostUpdate diff --git a/src/systems/kinetic_energy_monitor/KineticEnergyMonitor.hh b/src/systems/kinetic_energy_monitor/KineticEnergyMonitor.hh index de037608bd..25fa70239f 100644 --- a/src/systems/kinetic_energy_monitor/KineticEnergyMonitor.hh +++ b/src/systems/kinetic_energy_monitor/KineticEnergyMonitor.hh @@ -97,7 +97,7 @@ namespace systems \endverbatim */ - class IGNITION_GAZEBO_VISIBLE KineticEnergyMonitor: + class KineticEnergyMonitor: public System, public ISystemConfigure, public ISystemPostUpdate diff --git a/src/systems/logical_audio_sensor_plugin/LogicalAudio.hh b/src/systems/logical_audio_sensor_plugin/LogicalAudio.hh index 4835cd6b88..8eb7feb372 100644 --- a/src/systems/logical_audio_sensor_plugin/LogicalAudio.hh +++ b/src/systems/logical_audio_sensor_plugin/LogicalAudio.hh @@ -21,6 +21,7 @@ #include #include +#include #include namespace ignition @@ -41,6 +42,7 @@ namespace logical_audio /// device with a higher detection threshold. /// \return true if the listening device can detect volume at _volumeLevel, /// false otherwise. + IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE bool detect(double _volumeLevel, double _volumeDetectionThreshold); /// \brief Computes the volume level of an audio source at a certain location. @@ -61,6 +63,7 @@ namespace logical_audio /// \return The volume level at this location. /// If the attenuation function or shape is undefined, -1.0 is returned. /// If the source is not playing, 0.0 is returned. + IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE double computeVolume(bool _playing, AttenuationFunction _attenuationFunc, AttenuationShape _attenuationShape, @@ -83,6 +86,7 @@ namespace logical_audio /// the calculated attenuation function. /// \param[in] _str A string that should map to a value in /// AttenuationFunction. + IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void setAttenuationFunction(AttenuationFunction &_attenuationFunc, std::string _str); @@ -98,6 +102,7 @@ namespace logical_audio /// calculated attenuation shape. /// \param[in] _str A string that should map to a value in /// AttenuationShape. + IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void setAttenuationShape(AttenuationShape &_attenuationShape, std::string _str); @@ -110,6 +115,7 @@ namespace logical_audio /// source. This value must be greater than _innerRadius. /// If _falloffDistance < _innerRadius, _falloffDistance will be set to /// _innerRadius + 1 (assuming that _innerRadius is valid). + IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void validateInnerRadiusAndFalloffDistance(double &_innerRadius, double &_falloffDistance); @@ -117,6 +123,7 @@ namespace logical_audio /// \param[in,out] _volumeLevel The volume the source should play at. /// This parameter is checked (and possibly clipped) to ensure that it falls /// between 0.0 (0% volume) and 1.0 (100% volume). + IGNITION_GAZEBO_LOGICALAUDIOSENSORPLUGIN_SYSTEM_VISIBLE void validateVolumeLevel(double &_volumeLevel); } } diff --git a/test/integration/examples_build.cc b/test/integration/examples_build.cc index c76e92e689..1ae83450a4 100644 --- a/test/integration/examples_build.cc +++ b/test/integration/examples_build.cc @@ -78,7 +78,6 @@ bool createAndSwitchToTempDir(std::string &_newTempPath) #include // NOLINT(build/include_order) #include // NOLINT(build/include_order) #include -#include ///////////////////////////////////////////////// bool createAndSwitchToTempDir(std::string &_newTempPath) diff --git a/test/integration/save_world.cc b/test/integration/save_world.cc index 149ce5c3f3..1e9f5a6c22 100644 --- a/test/integration/save_world.cc +++ b/test/integration/save_world.cc @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/test/plugins/CMakeLists.txt b/test/plugins/CMakeLists.txt index 5cd26ef8cc..875076790f 100644 --- a/test/plugins/CMakeLists.txt +++ b/test/plugins/CMakeLists.txt @@ -13,12 +13,20 @@ set (test_plugins EventTriggerSystem TestModelSystem TestSensorSystem - TestSystem TestWorldSystem MockSystem Null ) +# TODO: someone with knowledge of ign-plugin please resolve: +# TestSystem.obj : error LNK2001: unresolved external symbol IgnitionPluginHook +if(NOT WIN32) + set (test_plugins + ${test_plugins} + TestSystem + ) +endif() + # Plugin shared libraries if(BUILD_TESTING) foreach (src ${test_plugins}) From eaac7eead3e140af9b76b9ab527e7d36a31655be Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 27 Jan 2021 17:42:52 +0100 Subject: [PATCH 4/8] Fix setenv to use ignition::common --- test/integration/kinetic_energy_monitor_system.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/kinetic_energy_monitor_system.cc b/test/integration/kinetic_energy_monitor_system.cc index bd5b1853ec..76d5e253e9 100644 --- a/test/integration/kinetic_energy_monitor_system.cc +++ b/test/integration/kinetic_energy_monitor_system.cc @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -38,8 +39,8 @@ class KineticEnergyMonitorTest : public ::testing::Test protected: void SetUp() override { ignition::common::Console::SetVerbosity(4); - setenv("IGN_GAZEBO_SYSTEM_PLUGIN_PATH", - (std::string(PROJECT_BINARY_PATH) + "/lib").c_str(), 1); + ignition::common::setenv("IGN_GAZEBO_SYSTEM_PLUGIN_PATH", + (std::string(PROJECT_BINARY_PATH) + "/lib").c_str()); } }; From b970350920645a1ca1fbe7c3689fe9736fa372e8 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Wed, 27 Jan 2021 17:50:40 +0100 Subject: [PATCH 5/8] Remove duplicate Signed-off-by: Jose Luis Rivero --- test/integration/save_world.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/save_world.cc b/test/integration/save_world.cc index 1e9f5a6c22..149ce5c3f3 100644 --- a/test/integration/save_world.cc +++ b/test/integration/save_world.cc @@ -27,7 +27,6 @@ #include #include -#include #include #include #include From 79dff1cae903672d510d51281feb0865cd41b0a2 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 28 Jan 2021 15:25:34 +0100 Subject: [PATCH 6/8] Revert removal of Q_OBJECT from GuiSystem Signed-off-by: Jose Luis Rivero --- include/ignition/gazebo/gui/GuiSystem.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/ignition/gazebo/gui/GuiSystem.hh b/include/ignition/gazebo/gui/GuiSystem.hh index 0218f47351..5fbdf1672c 100644 --- a/include/ignition/gazebo/gui/GuiSystem.hh +++ b/include/ignition/gazebo/gui/GuiSystem.hh @@ -17,6 +17,8 @@ #ifndef IGNITION_GAZEBO_GUI_GUISYSTEM_HH_ #define IGNITION_GAZEBO_GUI_GUISYSTEM_HH_ +#include + #include #include #include @@ -41,6 +43,8 @@ namespace gazebo /// separate process that is stepped by updates coming through the network class GuiSystem : public ignition::gui::Plugin { + Q_OBJECT + /// \brief Update callback called every time the system is stepped. /// This is called at an Ignition transport thread, so any interaction /// with Qt should be done through signals and slots. From d38c8f3b3d6d24f16d03f785b60f62871c7c9037 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 28 Jan 2021 15:26:36 +0100 Subject: [PATCH 7/8] Remove wd4146 warning supression. Make linter happy with withspaces and lenght Signed-off-by: Jose Luis Rivero --- src/systems/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/systems/CMakeLists.txt b/src/systems/CMakeLists.txt index b1cedf8414..cf7c9d9672 100644 --- a/src/systems/CMakeLists.txt +++ b/src/systems/CMakeLists.txt @@ -34,13 +34,13 @@ function(gz_add_system system_name) set(system_name ${system_name}-system) - if (MSVC) - # Warning #4251 is the "dll-interface" warning that tells you when types used - # by a class are not being exported. These generated source files have private - # members that don't get exported, so they trigger this warning. However, the - # warning is not important since those members do not need to be interfaced - # with. - set_source_files_properties(${sources} COMPILE_FLAGS "/wd4251 /wd4146") + if(MSVC) + # Warning #4251 is the "dll-interface" warning that tells you when types + # used by a class are not being exported. These generated source files have + # private members that don't get exported, so they trigger this warning. + # However, the warning is not important since those members do not need to + # be interfaced with. + set_source_files_properties(${sources} COMPILE_FLAGS "/wd4251") endif() From 991b75ce79e11e06cf19e321b6c9c20ccf9a9d28 Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Thu, 28 Jan 2021 17:41:38 +0100 Subject: [PATCH 8/8] Set visibility for GuiSystem Signed-off-by: Jose Luis Rivero --- include/ignition/gazebo/gui/GuiSystem.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ignition/gazebo/gui/GuiSystem.hh b/include/ignition/gazebo/gui/GuiSystem.hh index 5fbdf1672c..df6e2b6c66 100644 --- a/include/ignition/gazebo/gui/GuiSystem.hh +++ b/include/ignition/gazebo/gui/GuiSystem.hh @@ -41,7 +41,7 @@ namespace gazebo /// GUI systems are different from `ignition::gazebo::System`s because they /// don't run in the same process as the physics. Instead, they run in a /// separate process that is stepped by updates coming through the network - class GuiSystem : public ignition::gui::Plugin + class IGNITION_GAZEBO_GUI_VISIBLE GuiSystem : public ignition::gui::Plugin { Q_OBJECT