Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Fix Windows build when using vcpkg #3132

Merged
merged 4 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ else()
set(GAZEBO_SETUP_SH_PLUGIN_PATH ${GAZEBO_SETUP_SH_PLUGIN_LIB_INSTALL_DIR})
set(GAZEBO_PLUGIN_PATH ${GAZEBO_PLUGIN_LIB_INSTALL_DIR})
endif()
FILE(TO_NATIVE_PATH "${GAZEBO_PLUGIN_PATH}" GAZEBO_PLUGIN_PATH)
FILE(TO_CMAKE_PATH "${GAZEBO_PLUGIN_PATH}" GAZEBO_PLUGIN_PATH)
join_paths(GAZEBO_SETUP_SH_MODEL_PATH "\${installPrefix}" ${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/models)
set(GAZEBO_MODEL_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION}/models)
FILE(TO_NATIVE_PATH "${GAZEBO_MODEL_PATH}" GAZEBO_MODEL_PATH)
FILE(TO_CMAKE_PATH "${GAZEBO_MODEL_PATH}" GAZEBO_MODEL_PATH)
join_paths(GAZEBO_SETUP_SH_RESOURCE_PATH "\${installPrefix}" ${CMAKE_INSTALL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION})
set(GAZEBO_RESOURCE_PATH ${CMAKE_INSTALL_FULL_DATAROOTDIR}/gazebo-${GAZEBO_MAJOR_VERSION})
FILE(TO_NATIVE_PATH "${GAZEBO_RESOURCE_PATH}" GAZEBO_RESOURCE_PATH)
FILE(TO_CMAKE_PATH "${GAZEBO_RESOURCE_PATH}" GAZEBO_RESOURCE_PATH)
set(GAZEBO_MODEL_DATABASE_URI http://models.gazebosim.org)
set(OGRE_RESOURCE_PATH ${OGRE_PLUGINDIR})
# Seems that OGRE_PLUGINDIR can end in a newline, which will cause problems when
Expand Down
6 changes: 3 additions & 3 deletions cmake/FindGraphviz.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ endif ( GRAPHVIZ_CGRAPH_LIBRARY )

# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if( NOT WIN32 )
find_package(PkgConfig)
find_package(PkgConfig)
if( PkgConfig_FOUND )

pkg_check_modules(GRAPHVIZ_GVC_PKG libgvc)
pkg_check_modules(GRAPHVIZ_CGRAPH_PKG libcgraph)
pkg_check_modules(GRAPHVIZ_CDT_PKG libcdt)
endif( NOT WIN32 )
endif( PkgConfig_FOUND )

FIND_LIBRARY(GRAPHVIZ_GVC_LIBRARY NAMES gvc libgvc
PATHS
Expand Down
2 changes: 1 addition & 1 deletion cmake/GazeboUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ macro (gz_setup_windows)
endif()

if (MSVC)
add_compile_options(/Zc:__cplusplus)
add_compile_options(/Zc:__cplusplus /permissive- /Zc:strictStrings-)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the windows CI build is broken; I'm guessing it's related to this change?

[ 43%] Building CXX object gazebo/transport/CMakeFiles/gazebo_transport.dir/IOManager.cc.obj
C:\Jenkins\workspace\gazebo-ci-pr_any-windows7-amd64\ws\install\include\boost/interprocess/detail/win32_api.hpp(892): error C2116: 'GetProcessTimes': function parameter lists do not match between declarations
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\processthreadsapi.h(106): note: see declaration of 'GetProcessTimes'
C:\Jenkins\workspace\gazebo-ci-pr_any-windows7-amd64\ws\install\include\boost/interprocess/detail/win32_api.hpp(892): error C2733: 'GetProcessTimes': you cannot overload a function with 'extern "C"' linkage
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\processthreadsapi.h(106): note: see declaration of 'GetProcessTimes'
C:\Jenkins\workspace\gazebo-ci-pr_any-windows7-amd64\ws\install\include\boost/interprocess/detail/win32_api.hpp(908): error C2371: 'GetFileType': redefinition; different basic types
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\fileapi.h(708): note: see declaration of 'GetFileType'
C:\Jenkins\workspace\gazebo-ci-pr_any-windows7-amd64\ws\install\include\boost/interprocess/detail/win32_api.hpp(908): error C2733: 'GetFileType': you cannot overload a function with 'extern "C"' linkage
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a change. Hopefully that should fix it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are test failures, but those seem to have been happening for a while. Both tests seem to fail because they are using command not available on Windows cmd (make and rm). Would it be worth modifying them or removing them?

endif()
endmacro()

Expand Down
4 changes: 4 additions & 0 deletions gazebo/common/MeshCSG.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ typedef _GtsSurface GtsSurface;
struct _GPtrArray;
typedef _GPtrArray GPtrArray;

#ifdef DIFFERENCE
#undef DIFFERENCE
#endif

namespace gazebo
{
namespace common
Expand Down