From c1d5d7b63f51ddf88066ba34deaa597641587266 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Fri, 8 Jan 2021 13:41:42 +0100 Subject: [PATCH] gr-fosphor: Remove all SWIG stuff Part of GNURadio 3.9 migration Signed-off-by: Sylvain Munaut --- CMakeLists.txt | 4 +-- include/gnuradio/fosphor/qt_sink_c.h | 2 +- lib/qt_sink_c_impl.h | 2 +- python/CMakeLists.txt | 1 - python/__init__.py | 3 -- swig/CMakeLists.txt | 48 ---------------------------- swig/fosphor_swig.i | 30 ----------------- 7 files changed, 3 insertions(+), 87 deletions(-) delete mode 100644 swig/CMakeLists.txt delete mode 100644 swig/fosphor_swig.i diff --git a/CMakeLists.txt b/CMakeLists.txt index c94e50a..0ad9363 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,7 +125,6 @@ endif (Qt5_FOUND) find_package(Doxygen) find_package(PythonLibs 3) -find_package(SWIG) ######################################################################## # Setup doxygen option @@ -143,7 +142,7 @@ endif(DOXYGEN_FOUND) include(GrComponent) GR_REGISTER_COMPONENT("Python" ENABLE_PYTHON - PYTHONLIBS_FOUND SWIG_FOUND + PYTHONLIBS_FOUND ) GR_REGISTER_COMPONENT("GLFW" ENABLE_GLFW @@ -179,7 +178,6 @@ add_subdirectory(include/gnuradio/fosphor) add_subdirectory(lib) if(ENABLE_PYTHON) - add_subdirectory(swig) add_subdirectory(python) add_subdirectory(grc) add_subdirectory(apps) diff --git a/include/gnuradio/fosphor/qt_sink_c.h b/include/gnuradio/fosphor/qt_sink_c.h index eaf7462..e75cf7f 100644 --- a/include/gnuradio/fosphor/qt_sink_c.h +++ b/include/gnuradio/fosphor/qt_sink_c.h @@ -42,7 +42,7 @@ namespace gr { virtual void exec_() = 0; virtual QWidget* qwidget() = 0; -#if defined(PY_VERSION) || defined(SWIGPYTHON) +#if defined(PY_VERSION) virtual PyObject* pyqwidget() = 0; #else virtual void* pyqwidget() = 0; diff --git a/lib/qt_sink_c_impl.h b/lib/qt_sink_c_impl.h index af0e00e..ceb0183 100644 --- a/lib/qt_sink_c_impl.h +++ b/lib/qt_sink_c_impl.h @@ -43,7 +43,7 @@ namespace gr { void exec_(); QWidget* qwidget(); -#if defined(PY_VERSION) || defined(SWIGPYTHON) +#if defined(PY_VERSION) PyObject* pyqwidget(); #else void* pyqwidget(); diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 34e7aa5..57902c0 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -32,4 +32,3 @@ GR_PYTHON_INSTALL( include(GrTest) set(GR_TEST_TARGET_DEPS gnuradio-fosphor) -set(GR_TEST_PYTHON_DIRS ${CMAKE_BINARY_DIR}/swig) diff --git a/python/__init__.py b/python/__init__.py index 69c2353..6ed2a1b 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -4,6 +4,3 @@ # This file is part of gr-fosphor # # SPDX-License-Identifier: GPL-3.0-or-later - -# import swig generated symbols into the fosphor namespace -from .fosphor_swig import * diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt deleted file mode 100644 index 9424397..0000000 --- a/swig/CMakeLists.txt +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright 2011-2020 Free Software Foundation, Inc. -# Copyright 2013-2021 Sylvain Munaut -# -# This file is part of gr-fosphor -# -# SPDX-License-Identifier: GPL-3.0-or-later - -######################################################################## -# Include swig generation macros -######################################################################## -find_package(SWIG) -find_package(PythonLibs 3) -if(NOT SWIG_FOUND OR NOT PYTHONLIBS_FOUND) - return() -endif() -include(GrSwig) -include(GrPython) - -######################################################################## -# Setup swig generation -######################################################################## -set(GR_SWIG_INCLUDE_DIRS $) -set(GR_SWIG_TARGET_DEPS gnuradio::runtime_swig) - -set(GR_SWIG_LIBRARIES gnuradio-fosphor) - -set(GR_SWIG_DOC_FILE ${CMAKE_CURRENT_BINARY_DIR}/fosphor_swig_doc.i) -set(GR_SWIG_DOC_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../include/gnuradio/fosphor) - -list_cond_append(ENABLE_GLFW GR_SWIG_FLAGS -DENABLE_GLFW) -list_cond_append(ENABLE_QT GR_SWIG_FLAGS -DENABLE_QT) - -GR_SWIG_MAKE(fosphor_swig fosphor_swig.i) - -######################################################################## -# Install the build swig module -######################################################################## -GR_SWIG_INSTALL(TARGETS fosphor_swig DESTINATION ${GR_PYTHON_DIR}/gnuradio/fosphor) - -######################################################################## -# Install swig .i files for development -######################################################################## -install( - FILES - fosphor_swig.i - ${CMAKE_CURRENT_BINARY_DIR}/fosphor_swig_doc.i - DESTINATION ${GR_INCLUDE_DIR}/gnuradio/swig -) diff --git a/swig/fosphor_swig.i b/swig/fosphor_swig.i deleted file mode 100644 index 7806ec1..0000000 --- a/swig/fosphor_swig.i +++ /dev/null @@ -1,30 +0,0 @@ -/* -*- c++ -*- */ - -#define GR_FOSPHOR_API - -%include "gnuradio.i" // the common stuff - -//load generated python docstrings -%include "fosphor_swig_doc.i" - -%{ -#include "gnuradio/fosphor/glfw_sink_c.h" -#include "gnuradio/fosphor/qt_sink_c.h" -%} - -%typemap(in) gr::fft::window::win_type { - $1 = (gr::fft::window::win_type)(PyInt_AsLong($input)); -} - -%include "gnuradio/fosphor/base_sink_c.h" - -#ifdef ENABLE_GLFW -%nodefaultctor gr::fosphor::glfw_sink_c; // bug workaround -%include "gnuradio/fosphor/glfw_sink_c.h" -GR_SWIG_BLOCK_MAGIC2(fosphor, glfw_sink_c); -#endif - -#ifdef ENABLE_QT -%include "gnuradio/fosphor/qt_sink_c.h" -GR_SWIG_BLOCK_MAGIC2(fosphor, qt_sink_c); -#endif