From dfc60196ece39c3c2db4c4a12329ad422b0623dc Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Fri, 7 Aug 2026 15:59:25 +0500 Subject: [PATCH] ifcwrap/cmake: fix using `python:abc` feature on older swig --- src/ifcwrap/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ifcwrap/CMakeLists.txt b/src/ifcwrap/CMakeLists.txt index 4a1f843706..5a2e41ece0 100644 --- a/src/ifcwrap/CMakeLists.txt +++ b/src/ifcwrap/CMakeLists.txt @@ -108,6 +108,14 @@ ENDIF() set(_python_libs_version "${Python_VERSION_MAJOR}${Python_VERSION_MINOR}") INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}) +#`%feature("python:abc")` is a feature we use in swig template. +# Nn swig < 4.1 it works only if `-py3` is set explictily, +# in swig 4.1+ `-py3` is no-op. +# E.g. Ubuntu 22.04 is still using swig 4.0.2. +if(SWIG_VERSION VERSION_LESS "4.1") + list(APPEND SWIG_DEFINES -py3) +endif() + SET(CMAKE_SWIG_FLAGS ${SWIG_DEFINES}) if(WITH_CGAL)