Skip to content

Commit

Permalink
Merge pull request #14 from RoboStack/win-build
Browse files Browse the repository at this point in the history
Trigger windows builds
  • Loading branch information
Tobias-Fischer authored Jan 9, 2025
2 parents 54111e5 + e7f7d95 commit 9ceb040
Show file tree
Hide file tree
Showing 16 changed files with 382 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/testpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,5 @@ jobs:
shell: bash -l {0}
if: steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && steps.filecheck.outputs.WIN_YAML_CHANGED == 1 && matrix.platform == 'win-64'
run: |
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform win64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform win64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
$HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
8 changes: 8 additions & 0 deletions conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ c_stdlib_version:
- ${{ "2.17" if linux }}
- ${{ "10.14" if osx and x86_64 }}
- ${{ "11.0" if osx and arm64 }}
c_compiler:
- ${{ "gcc" if linux }}
- ${{ "clang" if osx }}
- ${{ "vs2019" if win }}
cxx_compiler:
- ${{ "gxx" if linux }}
- ${{ "clangxx" if osx }}
- ${{ "vs2019" if win }}
2 changes: 1 addition & 1 deletion patch/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ intra_process_demo:
add_host: ["REQUIRE_OPENGL"]
rviz_ogre_vendor:
add_host: ["zlib", "freeimage", "freetype", "assimp", "zziplib", "pugixml", "${{ 'libglu' if linux }}"]
add_build: ["vcstool", "patch"]
add_build: ["vcstool"]
add_run: ["assimp"]
pcl_conversions:
add_host: ["REQUIRE_OPENGL", "libboost-devel"]
Expand Down
15 changes: 14 additions & 1 deletion patch/ros-jazzy-fastrtps.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,17 @@ index 75ad33f2d64..252f60c775a 100644
+
namespace eprosima {

template<typename... Args>
template<typename... Args>
diff --git a/tools/fds/CMakeLists.txt b/tools/fds/CMakeLists.txt
index 899fe693..f1e7e37d 100644
--- a/tools/fds/CMakeLists.txt
+++ b/tools/fds/CMakeLists.txt
@@ -116,7 +116,7 @@ install(EXPORT ${PROJECT_NAME}-targets
if( WIN32 )
# Use powershell to generate the link
install(
- CODE "execute_process( COMMAND PowerShell -Command \"if( test-path ${PROJECT_NAME}.exe -PathType Leaf ) { rm ${PROJECT_NAME}.exe } ; New-Item -ItemType SymbolicLink -Target $<TARGET_FILE_NAME:${PROJECT_NAME}> -Path ${PROJECT_NAME}.exe \" ERROR_QUIET RESULTS_VARIABLE SYMLINK_FAILED WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}\") \n if( SYMLINK_FAILED ) \n message(STATUS \"Windows requires admin installation rights to create symlinks. A bat script will be provided instead.\") \n set(FAST_SERVER_BINARY_NAME $<TARGET_FILE_NAME:${PROJECT_NAME}>) \n configure_file(${CMAKE_CURRENT_LIST_DIR}/fast-discovery-server.bat.in ${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}${MSVCARCH_DIR_EXTENSION}/${PROJECT_NAME}.bat @ONLY) \n endif()"
+ CODE "execute_process( COMMAND PowerShell -Command \"if( test-path ${PROJECT_NAME}.exe -PathType Leaf ) { rm ${PROJECT_NAME}.exe } ; New-Item -ItemType HardLink -Target $<TARGET_FILE_NAME:${PROJECT_NAME}> -Path ${PROJECT_NAME}.exe \" ERROR_QUIET RESULTS_VARIABLE SYMLINK_FAILED WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}\") \n if( SYMLINK_FAILED ) \n message(STATUS \"Windows requires admin installation rights to create symlinks. A bat script will be provided instead.\") \n set(FAST_SERVER_BINARY_NAME $<TARGET_FILE_NAME:${PROJECT_NAME}>) \n configure_file(${CMAKE_CURRENT_LIST_DIR}/fast-discovery-server.bat.in ${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}${MSVCARCH_DIR_EXTENSION}/${PROJECT_NAME}.bat @ONLY) \n endif()"
COMPONENT discovery)
else()
# Use ln to create the symbolic link. We remove the version from the file name but keep the debug suffix
13 changes: 13 additions & 0 deletions patch/ros-jazzy-iceoryx-binding-c.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7863ddb..5f361df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,8 @@ include(IceoryxPoshDeployment)

if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin)
option(BUILD_SHARED_LIBS "Create shared libraries by default" ON)
+else()
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
endif()

set(PREFIX iceoryx/v${CMAKE_PROJECT_VERSION})
15 changes: 15 additions & 0 deletions patch/ros-jazzy-iceoryx-dds.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/iceoryx_dds/CMakeLists.txt b/iceoryx_dds/CMakeLists.txt
index ae1f9f83f..e79873a72 100644
--- a/iceoryx_dds/CMakeLists.txt
+++ b/iceoryx_dds/CMakeLists.txt
@@ -16,6 +16,10 @@
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.16)

+if(WIN32)
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
+endif()
+
set(IOX_VERSION_STRING "2.0.6")

project(iceoryx_dds VERSION ${IOX_VERSION_STRING})
13 changes: 13 additions & 0 deletions patch/ros-jazzy-iceoryx-hoofs.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f7cb43b..115964a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,8 @@ include("${CMAKE_CURRENT_LIST_DIR}/cmake/IceoryxPlatform.cmake")

if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin)
option(BUILD_SHARED_LIBS "Create shared libraries by default" ON)
+else()
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
endif()

set(PREFIX iceoryx/v${CMAKE_PROJECT_VERSION})
44 changes: 44 additions & 0 deletions patch/ros-jazzy-iceoryx-posh.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
diff --git a/iceoryx_posh/CMakeLists.txt b/iceoryx_posh/CMakeLists.txt
index 57e84cdd0..d7781cbb9 100644
--- a/iceoryx_posh/CMakeLists.txt
+++ b/iceoryx_posh/CMakeLists.txt
@@ -42,6 +42,8 @@ include(cmake/IceoryxPoshDeployment.cmake)

if(CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin)
option(BUILD_SHARED_LIBS "Create shared libraries by default" ON)
+else()
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
endif()

set(PREFIX iceoryx/v${CMAKE_PROJECT_VERSION})
diff --git a/iceoryx_posh/cmake/cpptoml/CMakeLists.txt b/iceoryx_posh/cmake/cpptoml/CMakeLists.txt
index e770e4fdba..a548376f1a 100644
--- a/iceoryx_posh/cmake/cpptoml/CMakeLists.txt
+++ b/iceoryx_posh/cmake/cpptoml/CMakeLists.txt
@@ -75,23 +75,13 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE)
endif()

execute_process(
- COMMAND git apply -R -p1 --ignore-space-change --whitespace=nowarn --check
+ COMMAND patch -p1 --forward --ignore-whitespace --fuzz=3
INPUT_FILE "${CMAKE_CURRENT_LIST_DIR}/0001-cpptoml-cmake-version.patch"
WORKING_DIRECTORY "${SOURCE_DIR}"
- OUTPUT_QUIET
- ERROR_QUIET
RESULT_VARIABLE result)
-if(result)
- message(STATUS "Applying patch for minimal cmake version to cpptoml")

- execute_process(
- COMMAND git apply -p1 --ignore-space-change --whitespace=nowarn
- INPUT_FILE "${CMAKE_CURRENT_LIST_DIR}/0001-cpptoml-cmake-version.patch"
- WORKING_DIRECTORY "${SOURCE_DIR}"
- RESULT_VARIABLE result)
- if(result)
- message(FATAL_ERROR "CMake step [patch] for '${PROJECT_NAME}' failed! Error code: ${result}!")
- endif()
+if(result)
+ message(FATAL_ERROR "CMake step [patch] for '${PROJECT_NAME}' failed! Error code: ${result}!")
endif()

execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" "-DENABLE_LIBCXX=off" "-DCPPTOML_BUILD_EXAMPLES=off" "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}" "${SOURCE_DIR}" ${CMAKE_ADDITIONAL_OPTIONS}
12 changes: 12 additions & 0 deletions patch/ros-jazzy-ros-gz-bridge.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/ros_gz_bridge/CMakeLists.txt b/ros_gz_bridge/CMakeLists.txt
index 44911577..76779457 100644
--- a/ros_gz_bridge/CMakeLists.txt
+++ b/ros_gz_bridge/CMakeLists.txt
@@ -11,4 +11,7 @@ if(NOT CMAKE_CXX_STANDARD)
+elseif(MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
9 changes: 9 additions & 0 deletions patch/ros-jazzy-ros-gz-sim.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/ros_gz_sim/CMakeLists.txt b/ros_gz_sim/CMakeLists.txt
index dc8deb03..ec6ac678 100644
--- a/ros_gz_sim/CMakeLists.txt
+++ b/ros_gz_sim/CMakeLists.txt
@@ -12,3 +12,4 @@ endif()
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
61 changes: 61 additions & 0 deletions patch/ros-jazzy-ros-workspace.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f2ed31b..50b5843 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,7 @@ project(ros_workspace NONE)
find_package(ament_cmake_core REQUIRED)

# Collect current python 3 version
-execute_process(COMMAND python3 -c "from distutils import sysconfig; print(sysconfig.get_python_version())" OUTPUT_VARIABLE PYTHON_MAJOR_MINOR OUTPUT_STRIP_TRAILING_WHITESPACE)
+find_package (Python COMPONENTS Interpreter Development)

# Locate ament_package template files.
if(WIN32)
@@ -14,7 +14,15 @@ else()
set(PYTHON_INSTALL_DIR "lib/python${PYTHON_MAJOR_MINOR}/site-packages")
set(SHELL_EXT "sh")
endif()
-set(AMENT_PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_DIR}/ament_package")
+set(AMENT_PACKAGE_DIR "${Python_SITELIB}/ament_package")
+
+if(NOT EXISTS "${AMENT_PACKAGE_DIR}" AND "$ENV{CONDA_BUILD_CROSS_COMPILATION}" EQUAL "1")
+ message(WARNING "Could not find '${AMENT_PACKAGE_DIR}'. Replace '$ENV{PREFIX}' with '$ENV{BUILD_PREFIX}'.")
+ string(REPLACE "$ENV{PREFIX}" "$ENV{BUILD_PREFIX}" AMENT_PACKAGE_DIR_REP ${AMENT_PACKAGE_DIR})
+ set(AMENT_PACKAGE_DIR "${AMENT_PACKAGE_DIR_REP}")
+ message(WARNING "Now try '${AMENT_PACKAGE_DIR}'.")
+endif()
+
if(NOT EXISTS "${AMENT_PACKAGE_DIR}")
# Check for an .egg-link file and use the listed directory if it exists
get_filename_component(AMENT_PACKAGE_EGG_LINK "${AMENT_PACKAGE_DIR}" DIRECTORY)
@@ -38,28 +46,7 @@ set(
"prepend-non-duplicate;PYTHONPATH;${PYTHON_INSTALL_DIR}")

# Set environment hooks for default environment.
-if(WIN32)
- ament_environment_hooks("${PYTHONPATH_HOOK}")
-else()
- set(LIBRARY_PATH_HOOK "${AMENT_PACKAGE_TEMPLATE_DIR}/environment_hook/library_path.${SHELL_EXT}")
- # enable C language so that a trycompile can determine what the
- # anticipated libdir will be.
- enable_language(C)
- include(GNUInstallDirs)
- if(NOT ${CMAKE_INSTALL_LIBDIR} STREQUAL "lib")
- # register multiarch information for .dsv generation
- if(APPLE)
- set(LIBRARY_PATH_ENV_VAR "DYLD_LIBRARY_PATH")
- else()
- set(LIBRARY_PATH_ENV_VAR "LD_LIBRARY_PATH")
- endif()
- set(
- AMENT_CMAKE_ENVIRONMENT_HOOKS_DESC_multiarch_library_paths
- "prepend-non-duplicate;${LIBRARY_PATH_ENV_VAR};${CMAKE_INSTALL_LIBDIR}")
- set(MULTIARCH_LIBRARY_PATH_HOOK "env-hooks/multiarch_library_paths.sh.in")
- endif()
- ament_environment_hooks("${LIBRARY_PATH_HOOK}" "${PYTHONPATH_HOOK}" ${MULTIARCH_LIBRARY_PATH_HOOK})
-endif()
+ament_environment_hooks("${BINARY_PATH_HOOK}" "${PYTHONPATH_HOOK}")

# skip using ament_index/resource_index/parent_prefix_path
# if for Debian packages it is known that there are no underlays

170 changes: 170 additions & 0 deletions patch/ros-jazzy-theora-image-transport.win.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67612f0..355d45e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,10 +23,10 @@ find_package(std_msgs REQUIRED)

find_package(OpenCV REQUIRED imgproc)
find_package(PkgConfig)
-pkg_check_modules(PC_OGG REQUIRED ogg)
-pkg_check_modules(PC_THEORA REQUIRED theora)
-pkg_check_modules(PC_THEORAENC REQUIRED theoraenc)
-pkg_check_modules(PC_THEORADEC REQUIRED theoradec)
+list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
+
+find_package(OGG REQUIRED)
+find_package(THEORA REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"msg/Packet.msg"
@@ -55,13 +55,13 @@ target_compile_definitions(${LIBRARY_NAME} PRIVATE
target_include_directories(${LIBRARY_NAME} PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>"
-)
+ ${THEORA_INCLUDE_DIRS}
+ ${OGG_INCLUDE_DIRS})
+
target_link_libraries(${LIBRARY_NAME}
opencv_imgproc
- ${PC_OGG_LIBRARIES}
- ${PC_THEORA_LIBRARIES}
- ${PC_THEORAENC_LIBRARIES}
- ${PC_THEORADEC_LIBRARIES}
+ ${OGG_LIBRARIES}
+ ${THEORA_LIBRARIES}
"${cpp_typesupport_target}"
${sensor_msgs_TARGETS}
cv_bridge::cv_bridge
@@ -71,20 +71,13 @@ target_link_libraries(${LIBRARY_NAME}
)

add_executable(ogg_saver src/ogg_saver.cpp)
-target_compile_definitions(ogg_saver PRIVATE
- ${PC_OGG_CFLAGS_OTHER}
- ${PC_THEORA_CFLAGS_OTHER}
- ${PC_THEORAENC_CFLAGS_OTHER}
- ${PC_THEORADEC_CFLAGS_OTHER}
-)
-target_link_libraries(ogg_saver
- ${PC_THEORA_LIBRARY}
- ${PC_OGG_LIBRARY}
- ${PC_THEORAENC_LIBRARIES}
- ${PC_THEORADEC_LIBRARIES}
- "${cpp_typesupport_target}"
- rclcpp::rclcpp
- rcutils::rcutils
+
+target_link_libraries(ogg_saver ${THEORA_LIBRARIES}
+ ${OGG_LIBRARIES}
+ ${OpenCV_LIBRARIES}
+ "${cpp_typesupport_target}"
+ rclcpp::rclcpp
+ rcutils::rcutils
)

ament_export_dependencies(
diff --git a/cmake/FindOGG.cmake b/cmake/FindOGG.cmake
new file mode 100644
index 0000000..3121d17
--- /dev/null
+++ b/cmake/FindOGG.cmake
@@ -0,0 +1,26 @@
+find_path(OGG_INCLUDE_DIR
+ NAMES
+ ogg/ogg.h
+ DOC "ogg include directory")
+mark_as_advanced(OGG_INCLUDE_DIR)
+
+find_library(OGG_LIBRARY
+ NAMES
+ ogg
+ DOC "ogg library")
+mark_as_advanced(OGG_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(OGG REQUIRED_VARS OGG_LIBRARY OGG_INCLUDE_DIR)
+
+if (OGG_FOUND)
+ set(OGG_LIBRARIES "${OGG_LIBRARY}")
+ set(OGG_INCLUDE_DIRS "${OGG_INCLUDE_DIR}")
+
+ if (NOT TARGET OGG::OGG)
+ add_library(OGG::OGG UNKNOWN IMPORTED)
+ set_target_properties(OGG::OGG PROPERTIES
+ IMPORTED_LOCATION "${OGG_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIR}")
+ endif ()
+endif ()
diff --git a/cmake/FindTHEORA.cmake b/cmake/FindTHEORA.cmake
new file mode 100644
index 0000000..b69dd2c
--- /dev/null
+++ b/cmake/FindTHEORA.cmake
@@ -0,0 +1,66 @@
+include(CMakeFindDependencyMacro)
+
+find_path(THEORA_INCLUDE_DIR
+ NAMES
+ theora/theora.h
+ DOC "theora include directory")
+mark_as_advanced(THEORA_INCLUDE_DIR)
+
+get_filename_component(computed_theora_root "${THEORA_INCLUDE_DIR}" DIRECTORY)
+
+find_library(THEORA_LIBRARY
+ NAMES
+ theora
+ HINTS
+ "${computed_theora_root}/lib"
+ "${computed_theora_root}/lib64"
+ DOC "theora library")
+mark_as_advanced(THEORA_LIBRARY)
+
+find_library(THEORA_enc_LIBRARY
+ NAMES
+ theoraenc
+ HINTS
+ "${computed_theora_root}/lib"
+ "${computed_theora_root}/lib64"
+ DOC "theora encoding library")
+mark_as_advanced(THEORA_enc_LIBRARY)
+
+find_library(THEORA_dec_LIBRARY
+ NAMES
+ theoradec
+ HINTS
+ "${computed_theora_root}/lib"
+ "${computed_theora_root}/lib64"
+ DOC "theora decoding library")
+mark_as_advanced(THEORA_dec_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(THEORA
+ REQUIRED_VARS THEORA_LIBRARY THEORA_enc_LIBRARY THEORA_dec_LIBRARY THEORA_INCLUDE_DIR)
+
+if (THEORA_FOUND)
+ set(THEORA_LIBRARIES "${THEORA_LIBRARY}" "${THEORA_enc_LIBRARY}" "${THEORA_dec_LIBRARY}")
+ set(THEORA_INCLUDE_DIRS "${THEORA_INCLUDE_DIR}")
+
+ if (NOT TARGET THEORA::THEORA)
+ add_library(THEORA::THEORA UNKNOWN IMPORTED)
+ set_target_properties(THEORA::THEORA PROPERTIES
+ IMPORTED_LOCATION "${THEORA_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES ${THEORA_INCLUDE_DIR})
+ endif ()
+
+ if (NOT TARGET THEORA::ENC)
+ add_library(THEORA::ENC UNKNOWN IMPORTED)
+ set_target_properties(THEORA::ENC PROPERTIES
+ IMPORTED_LOCATION "${THEORA_enc_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES ${THEORA_INCLUDE_DIR})
+ endif()
+
+ if (NOT TARGET THEORA::DEC)
+ add_library(THEORA::DEC UNKNOWN IMPORTED)
+ set_target_properties(THEORA::DEC PROPERTIES
+ IMPORTED_LOCATION "${THEORA_dec_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES ${THEORA_INCLUDE_DIR})
+ endif()
+endif ()
Loading

0 comments on commit 9ceb040

Please sign in to comment.