Skip to content

Commit

Permalink
Avoid deprecation warning for -py3 in swig >= 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gjanssens committed Feb 22, 2024
1 parent 31cc25d commit cbf89a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ endif()
# SWIG
find_package (SWIG 3.0.12 REQUIRED)
include (${SWIG_USE_FILE})
string(REGEX MATCH "^[0-9]+[.]" SWIG_MAJOR ${SWIG_VERSION})

# Find Guile and determine which version we are using.
# Look for guile versions in this order: 3.0 > 2.2 > 2.0
Expand Down
7 changes: 6 additions & 1 deletion common/cmake_modules/GncAddSwigCommand.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,15 @@ macro (gnc_add_swig_python_command _target _out_var _py_out_var _output _py_outp
set(${_py_out_var} ${py_outfile}) # This variable is set for convenience to use in the calling CMakeLists.txt

set (DEFAULT_SWIG_PYTHON_FLAGS
-python -py3
-python
-Wall -Werror
${SWIG_ARGS}
)
if (${SWIG_VERSION} VERSION_LESS 4.1)
set (DEFAULT_SWIG_PYTHON_FLAGS
${SWIG_ARGS} -py3
)
endif()
set (DEFAULT_SWIG_PYTHON_C_INCLUDES
${GLIB2_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/common
Expand Down

0 comments on commit cbf89a7

Please sign in to comment.