diff --git a/Components/Csharp/CMakeLists.txt b/Components/Csharp/CMakeLists.txt index 9101b289283..96a50ff2150 100644 --- a/Components/Csharp/CMakeLists.txt +++ b/Components/Csharp/CMakeLists.txt @@ -27,7 +27,11 @@ else() add_definitions(-Wno-strict-aliasing -Wno-cast-qual -Wno-shadow -Wno-missing-declarations -Wno-unused-but-set-variable) endif() -set(CMAKE_SWIG_FLAGS -w401,314 -namespace org.ogre -Dfinal) +set(CMAKE_SWIG_FLAGS -w401,314 -namespace org.ogre) + +if(SWIG_VERSION VERSION_LESS "4.1") + list(APPEND CMAKE_SWIG_FLAGS -Dfinal) +endif() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/csharp/") set(CMAKE_SWIG_OUTDIR "${PROJECT_BINARY_DIR}/csharp/") diff --git a/Components/Java/CMakeLists.txt b/Components/Java/CMakeLists.txt index c744ed9fd52..7e664d318a6 100644 --- a/Components/Java/CMakeLists.txt +++ b/Components/Java/CMakeLists.txt @@ -27,7 +27,11 @@ else() endif() endif() -set(CMAKE_SWIG_FLAGS -w401,314 -package org.ogre -Dfinal) +set(CMAKE_SWIG_FLAGS -w401,314 -package org.ogre) + +if(SWIG_VERSION VERSION_LESS "4.1") + list(APPEND CMAKE_SWIG_FLAGS -Dfinal) +endif() if (APPLE AND NOT ANDROID) # we are using libc++ on OSX diff --git a/Components/Python/CMakeLists.txt b/Components/Python/CMakeLists.txt index 93923ccd841..1a9828107ce 100644 --- a/Components/Python/CMakeLists.txt +++ b/Components/Python/CMakeLists.txt @@ -14,7 +14,11 @@ if(SKBUILD) set(PYTHON_SITE_PACKAGES Ogre/) endif() -set(CMAKE_SWIG_FLAGS -w401,314 -builtin -Dfinal) +set(CMAKE_SWIG_FLAGS -w401,314 -builtin) + +if(SWIG_VERSION VERSION_LESS "4.1") + list(APPEND CMAKE_SWIG_FLAGS -Dfinal) +endif() if (APPLE AND NOT ANDROID) # we are using libc++ on OSX diff --git a/pyproject.toml b/pyproject.toml index 83d5393b83a..9c640b935c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "scikit-build", "cmake", "pip", "swig==4.0.2"] +requires = ["setuptools", "wheel", "scikit-build", "cmake", "pip", "swig"]