Make SWIG aware of PYTHON3 for its bindings and remove threads

This removes the threading from the SWIG interface (it was supposed to
be off by default) and adds support for Python3 bindings when supported
by the system
This commit is contained in:
Seth Hillbrand 2020-09-15 17:21:50 -07:00
parent ea06c16255
commit 0f22e8e2fe
1 changed files with 9 additions and 2 deletions

View File

@ -437,8 +437,15 @@ if( KICAD_SCRIPTING ) # Generate pcbnew.py and pcbnew_wrap.cxx using swig
# We deliberately do not use the CMake support for swig here, # We deliberately do not use the CMake support for swig here,
# i.e. swig_add_footprint()) because we want full control. # i.e. swig_add_footprint()) because we want full control.
set( SWIG_OPTS -python -c++ -outdir ${CMAKE_CURRENT_BINARY_DIR} ${SWIG_FLAGS} ) # Avoid threading in SWIG (breaks threads in pcbnew)
set( SWIG_OPTS -python -c++ -nothreads )
if( KICAD_SCRIPTING_PYTHON3 )
set( SWIG_OPTS ${SWIG_OPTS} -py3 )
endif()
set( SWIG_OPTS ${SWIG_OPTS} -outdir ${CMAKE_CURRENT_BINARY_DIR} ${SWIG_FLAGS} )
if( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/doxygen-xml ) if( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/doxygen-xml )
set( SWIG_OPTS ${SWIG_OPTS} -DENABLE_DOCSTRINGS_FROM_DOXYGEN ) set( SWIG_OPTS ${SWIG_OPTS} -DENABLE_DOCSTRINGS_FROM_DOXYGEN )