Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fixes for Windows - codecheck patches (part 1) #501

Merged
merged 30 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4719b87
Fix for Protobuf compiler
j-rivero Dec 11, 2020
b860682
No symlink on Windows
j-rivero Dec 11, 2020
25150a4
Add missing <optional> headers
j-rivero Dec 11, 2020
d8f5da7
Missing header for accumulate
j-rivero Dec 11, 2020
3555c8f
Fix error with experimental on MSVC
j-rivero Dec 11, 2020
a77513c
Add missing visible macros
j-rivero Dec 16, 2020
caaa192
Fixes for Windows in CMake
j-rivero Dec 16, 2020
a66a2d0
Portable setenv/getenv
j-rivero Dec 17, 2020
c0a291b
Fix API for setenv
j-rivero Dec 17, 2020
9a2b071
Protobuf requires no visibility keywords
j-rivero Dec 17, 2020
3a48576
Fix use of filesystem on Windows
j-rivero Dec 17, 2020
d6e88fa
Workaround for getMessage Windows call
j-rivero Dec 17, 2020
591980e
Include codecheck fixes
j-rivero Dec 18, 2020
1562680
Fix style for comment
j-rivero Dec 18, 2020
eeb3aab
Merge branch 'main' into win_pr1
j-rivero Dec 18, 2020
3dd83b2
Fix typo in ignition
j-rivero Dec 18, 2020
4209742
Patch system installation
j-rivero Dec 18, 2020
97dbbe2
Merge branch 'win_pr1' of github.com:ignitionrobotics/ign-gazebo into…
j-rivero Dec 18, 2020
31c8410
Bump to ign-transport10 and msgs7
Dec 23, 2020
8b8fb07
Merge branch 'ign-gazebo5' into win_pr1
j-rivero Jan 4, 2021
9011b3d
Remove .cc file in favor of header only
j-rivero Jan 12, 2021
3cc15b7
Merge branch 'main' into win_pr1
j-rivero Jan 14, 2021
d7959ea
Merge branch 'main' into win_pr1
j-rivero Jan 19, 2021
c91424f
Remove changes handled in a different PR
j-rivero Jan 19, 2021
926cbbd
Merge branch 'main' into win_pr1
j-rivero Jan 20, 2021
814081e
Update LeeVelocityController.hh
j-rivero Jan 20, 2021
2a9836f
Use ADD_CUSTOM_COMMAND to copy unversioned file of plugins
j-rivero Jan 20, 2021
5609b37
Merge branch 'main' into win_pr1
j-rivero Jan 21, 2021
8c6b51f
Remove duplicate
j-rivero Jan 22, 2021
5f23c9c
Merge branch 'main' of github.com:ignitionrobotics/ign-gazebo into wi…
j-rivero Jan 22, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ set(IGN_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR})

#--------------------------------------
# Find ignition-transport
ign_find_package(ignition-transport9 REQUIRED COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport9_VERSION_MAJOR})
ign_find_package(ignition-transport10 REQUIRED COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport10_VERSION_MAJOR})

#--------------------------------------
# Find ignition-msgs
ign_find_package(ignition-msgs6 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs6_VERSION_MAJOR})
ign_find_package(ignition-msgs7 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs7_VERSION_MAJOR})

#--------------------------------------
# Find ignition-common
Expand Down Expand Up @@ -124,13 +124,15 @@ set(IGN_MATH_VER ${ignition-math6_VERSION_MAJOR})

#--------------------------------------
# Find protobuf
# Module is needed to use the PROTOBUF_GENERATE_CPP
set(protobuf_MODULE_COMPATIBLE TRUE)
set(REQ_PROTOBUF_VER 3)
ign_find_package(IgnProtobuf
VERSION ${REQ_PROTOBUF_VER}
REQUIRED
COMPONENTS all
PRETTY Protobuf)
set(PROTOBUF_IMPORT_DIRS ${ignition-msgs6_INCLUDE_DIRS})
set(Protobuf_IMPORT_DIRS ${ignition-msgs7_INCLUDE_DIRS})

# Plugin install dirs
set(IGNITION_GAZEBO_PLUGIN_INSTALL_DIR
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ line is using symbolic links to each library's YAML file.
mkdir ~/.ignition/tools/configs -p
cd ~/.ignition/tools/configs/
ln -s /usr/local/share/ignition/fuel4.yaml .
ln -s /usr/local/share/ignition/transport9.yaml .
ln -s /usr/local/share/ignition/transportlog9.yaml .
ln -s /usr/local/share/ignition/transport10.yaml .
ln -s /usr/local/share/ignition/transportlog10.yaml .
...
export IGN_CONFIG_PATH=$HOME/.ignition/tools/configs
```
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ RUN apt-get update \
libignition-physics3-dev \
libignition-rendering5-dev \
libignition-tools-dev \
libignition-transport9-dev \
libignition-transport10-dev \
libignition-gui5-dev \
libignition-msgs6-dev \
libignition-msgs7-dev \
libignition-sensors5-dev \
libsdformat10-dev

Expand Down
4 changes: 2 additions & 2 deletions examples/standalone/joy_to_twist/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

find_package(ignition-transport9 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport9_VERSION_MAJOR})
find_package(ignition-transport10 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport10_VERSION_MAJOR})

find_package(sdformat10 REQUIRED)
set(SDF_VER ${sdformat10_VERSION_MAJOR})
Expand Down
4 changes: 2 additions & 2 deletions examples/standalone/joystick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
# joystick currently works only on linux

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_package(ignition-transport9 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport9_VERSION_MAJOR})
find_package(ignition-transport10 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport10_VERSION_MAJOR})

find_package(sdformat10 REQUIRED)
set(SDF_VER ${sdformat10_VERSION_MAJOR})
Expand Down
8 changes: 4 additions & 4 deletions examples/standalone/keyboard/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_package(ignition-transport9 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport9_VERSION_MAJOR})
find_package(ignition-transport10 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport10_VERSION_MAJOR})

find_package(sdformat10 REQUIRED)
set(SDF_VER ${sdformat10_VERSION_MAJOR})

find_package(ignition-msgs6 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs6_VERSION_MAJOR})
find_package(ignition-msgs7 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs7_VERSION_MAJOR})

find_package(ignition-common3 REQUIRED)
set(IGN_COMMON_VER ${ignition-common3_VERSION_MAJOR})
Expand Down
8 changes: 4 additions & 4 deletions examples/standalone/marker/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
find_package(ignition-transport9 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport9_VERSION_MAJOR})
find_package(ignition-transport10 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport10_VERSION_MAJOR})

find_package(ignition-common3 REQUIRED)
set(IGN_COMMON_VER ${ignition-common3_VERSION_MAJOR})

find_package(ignition-msgs6 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs6_VERSION_MAJOR})
find_package(ignition-msgs7 REQUIRED)
set(IGN_MSGS_VER ${ignition-msgs7_VERSION_MAJOR})

add_executable(marker marker.cc)
target_link_libraries(marker
Expand Down
4 changes: 2 additions & 2 deletions examples/standalone/scene_requester/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)

find_package(ignition-transport9 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport9_VERSION_MAJOR})
find_package(ignition-transport10 QUIET REQUIRED OPTIONAL_COMPONENTS log)
set(IGN_TRANSPORT_VER ${ignition-transport10_VERSION_MAJOR})

add_executable(scene_requester scene_requester.cc)
target_link_libraries(scene_requester
Expand Down
1 change: 1 addition & 0 deletions include/ignition/gazebo/EntityComponentManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <typeinfo>
Expand Down
2 changes: 1 addition & 1 deletion include/ignition/gazebo/EventManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace ignition
/// occur.
///
/// See \ref ignition::gazebo::events for a complete list of events.
class IGNITION_GAZEBO_VISIBLE EventManager
class EventManager
chapulina marked this conversation as resolved.
Show resolved Hide resolved
{
/// \brief Constructor
public: EventManager();
Expand Down
1 change: 1 addition & 0 deletions include/ignition/gazebo/Server.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <ignition/gazebo/config.hh>
#include <ignition/gazebo/EntityComponentManager.hh>
Expand Down
1 change: 1 addition & 0 deletions include/ignition/gazebo/World.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define IGNITION_GAZEBO_WORLD_HH_

#include <memory>
#include <optional>
#include <string>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions include/ignition/gazebo/detail/EntityComponentManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <cstring>
#include <map>
#include <optional>
#include <set>
#include <utility>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion include/ignition/gazebo/gui/GuiRunner.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace gazebo
inline namespace IGNITION_GAZEBO_VERSION_NAMESPACE {
/// \brief Responsible for running GUI systems as new states are received from
/// the backend.
class IGNITION_GAZEBO_VISIBLE GuiRunner : public QObject
class GuiRunner : public QObject
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion include/ignition/gazebo/gui/GuiSystem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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 IGNITION_GAZEBO_VISIBLE GuiSystem : public ignition::gui::Plugin
class GuiSystem : public ignition::gui::Plugin
{
Q_OBJECT

Expand Down
2 changes: 1 addition & 1 deletion include/ignition/gazebo/gui/TmpIface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace ignition
/// Move API from here to their appropriate locations once that's known.
///
/// This class should be removed before releasing!
class IGNITION_GAZEBO_VISIBLE TmpIface : public QObject
class TmpIface : public QObject
{
Q_OBJECT

Expand Down
11 changes: 10 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@ set (gtest_sources
network/NetworkManager_TEST.cc
)

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} ${gtest_sources} COMPILE_FLAGS "/wd4251 /wd4146")
endif()

# Create the library target
ign_create_core_library(SOURCES ${sources} CXX_STANDARD 17)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
Expand All @@ -101,7 +110,7 @@ target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE
ignition-plugin${IGN_PLUGIN_VER}::loader
)
if (NOT APPLE)
if (UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_LIBRARY_TARGET_NAME}
PRIVATE stdc++fs)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/LevelManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace ignition
/// when the level is reloaded. Likewise, they should not be deleted.
/// * Entities spawned during simulation are part of the default level.
///
class LevelManager
class IGNITION_GAZEBO_VISIBLE LevelManager
{
/// \brief Constructor
/// \param[in] _runner A pointer to the simulationrunner that owns this
Expand Down
1 change: 1 addition & 0 deletions src/SdfGenerator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <ignition/msgs/sdf_generator_config.pb.h>

#include <sdf/Element.hh>
#include <optional>
#include <string>
#include <unordered_map>

Expand Down
2 changes: 2 additions & 0 deletions src/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*
*/

#include <numeric>

#include <ignition/common/SystemPaths.hh>
#include <ignition/fuel_tools/Interface.hh>
#include <ignition/fuel_tools/ClientConfig.hh>
Expand Down
1 change: 1 addition & 0 deletions src/ServerPrivate.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <condition_variable>
#include <memory>
#include <mutex>
#include <optional>
#include <string>
#include <thread>
#include <unordered_map>
Expand Down
24 changes: 12 additions & 12 deletions src/Server_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class ServerFixture : public ::testing::TestWithParam<int>
protected: void SetUp() override
{
// Augment the system plugin path. In SetUp to avoid test order issues.
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());

ignition::common::Console::SetVerbosity(4);
}
Expand Down Expand Up @@ -783,9 +783,9 @@ TEST_P(ServerFixture, Seed)
/////////////////////////////////////////////////
TEST_P(ServerFixture, ResourcePath)
{
setenv("IGN_GAZEBO_RESOURCE_PATH",
ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH",
(std::string(PROJECT_SOURCE_PATH) + "/test/worlds:" +
std::string(PROJECT_SOURCE_PATH) + "/test/worlds/models").c_str(), 1);
std::string(PROJECT_SOURCE_PATH) + "/test/worlds/models").c_str());

ServerConfig serverConfig;
serverConfig.SetSdfFile("resource_paths.sdf");
Expand Down Expand Up @@ -871,8 +871,8 @@ TEST_P(ServerFixture, ResourcePath)
/////////////////////////////////////////////////
TEST_P(ServerFixture, GetResourcePaths)
{
setenv("IGN_GAZEBO_RESOURCE_PATH",
"/tmp/some/path:/home/user/another_path", 1);
ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH",
"/tmp/some/path:/home/user/another_path");

ServerConfig serverConfig;
gazebo::Server server(serverConfig);
Expand Down Expand Up @@ -903,7 +903,7 @@ TEST_P(ServerFixture, CachedFuelWorld)
{
auto cachedWorldPath =
common::joinPaths(std::string(PROJECT_SOURCE_PATH), "test", "worlds");
setenv("IGN_FUEL_CACHE_PATH", cachedWorldPath.c_str(), 1);
ignition::common::setenv("IGN_FUEL_CACHE_PATH", cachedWorldPath.c_str());

ServerConfig serverConfig;
auto fuelWorldURL =
Expand All @@ -927,10 +927,10 @@ TEST_P(ServerFixture, CachedFuelWorld)
/////////////////////////////////////////////////
TEST_P(ServerFixture, AddResourcePaths)
{
setenv("IGN_GAZEBO_RESOURCE_PATH",
"/tmp/some/path:/home/user/another_path", 1);
setenv("SDF_PATH", "", 1);
setenv("IGN_FILE_PATH", "", 1);
ignition::common::setenv("IGN_GAZEBO_RESOURCE_PATH",
"/tmp/some/path:/home/user/another_path");
ignition::common::setenv("SDF_PATH", "");
ignition::common::setenv("IGN_FILE_PATH", "");

ServerConfig serverConfig;
gazebo::Server server(serverConfig);
Expand Down Expand Up @@ -974,7 +974,7 @@ TEST_P(ServerFixture, AddResourcePaths)
// Check environment variables
for (auto env : {"IGN_GAZEBO_RESOURCE_PATH", "SDF_PATH", "IGN_FILE_PATH"})
{
char *pathCStr = getenv(env);
char *pathCStr = std::getenv(env);

auto paths = common::Split(pathCStr, ':');
paths.erase(std::remove_if(paths.begin(), paths.end(),
Expand Down
1 change: 1 addition & 0 deletions src/SimulationRunner.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <functional>
#include <list>
#include <memory>
#include <optional>
#include <string>
#include <unordered_map>
#include <unordered_set>
Expand Down
5 changes: 3 additions & 2 deletions src/SimulationRunner_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <gtest/gtest.h>
#include <ignition/common/Console.hh>
#include <ignition/common/Util.hh>
#include <ignition/transport/Node.hh>
#include <sdf/Box.hh>
#include <sdf/Cylinder.hh>
Expand Down Expand Up @@ -81,8 +82,8 @@ class SimulationRunnerTest : public ::testing::TestWithParam<int>
{
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());
}
};

Expand Down
Loading