From d4b13b5f8aa801c6f8c957e65603c2f8979a4ec6 Mon Sep 17 00:00:00 2001 From: Marco Randazzo Date: Tue, 21 Jan 2025 20:13:19 +0100 Subject: [PATCH] fix for c# with swig version 4.2.1 --- .github/workflows/ci.yml | 13 +++++++++++++ bindings/yarp.i | 2 ++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13b23279b9e..6b1f39a1dd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1434,6 +1434,7 @@ jobs: set(_cmake_extra_options ${{ matrix.config.cmake_extra_options }}) endif() + #SWIGFIX temporary fix for swig 4.2.1. The following lines should be removed. set(_swig_extra_options) if(NOT "${{ matrix.config.swig_extra_options }}" STREQUAL "") set(_swig_extra_options ${{ matrix.config.swig_extra_options }}) @@ -1592,6 +1593,12 @@ jobs: -D CMAKE_CXX_COMPILER_LAUNCHER=${_ccache_cmd}) endif() + #SWIGFIX temporary fix for swig 4.2.1. The following lines should be removed. + set(_swig_extra_options) + if(NOT "${{ matrix.config.swig_extra_options }}" STREQUAL "") + set(_swig_extra_options ${{ matrix.config.swig_extra_options }}) + endif() + execute_process_x( COMMAND ${CMAKE_COMMAND} -S bindings @@ -1669,6 +1676,12 @@ jobs: -D CMAKE_CXX_COMPILER_LAUNCHER=${_ccache_cmd}) endif() + #SWIGFIX temporary fix for swig 4.2.1. The following lines should be removed. + set(_swig_extra_options) + if(NOT "${{ matrix.config.swig_extra_options }}" STREQUAL "") + set(_swig_extra_options ${{ matrix.config.swig_extra_options }}) + endif() + execute_process_x( COMMAND ${CMAKE_COMMAND} -S bindings diff --git a/bindings/yarp.i b/bindings/yarp.i index 24d18189e47..ca7cceac030 100644 --- a/bindings/yarp.i +++ b/bindings/yarp.i @@ -451,9 +451,11 @@ MAKE_COMMS(Bottle) %include "matlab/vectors_fromTo_matlab.i" #endif +#if SWIG_VERSION < 0x040201 #if defined(SWIGCSHARP) SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(Pid,yarp::dev::Pid) #endif +#endif %template(PidVector) std::vector; //////////////////////////////////////////////////////////////////////////