summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <[email protected]>2019-12-07 12:34:17 +0100
committerSander Vrijders <[email protected]>2019-12-08 10:03:36 +0100
commite87a839c128b30651a354693d7dd40ce9fa3921f (patch)
tree1cf700c16ea9bf15c3c137acceabe8c6e51ed33d
parent80eb05876f302ef713556637a54bf82c00506139 (diff)
downloadouroboros-e87a839c128b30651a354693d7dd40ce9fa3921f.tar.gz
ouroboros-e87a839c128b30651a354693d7dd40ce9fa3921f.zip
build: Remove support for SWIG
This removes support for SWIG since it wasn't correctly generating all bindings. Since our API is lean, we will write the bindings for different languages from scratch. Signed-off-by: Dimitri Staessens <[email protected]> Signed-off-by: Sander Vrijders <[email protected]>
-rw-r--r--include/ouroboros/CMakeLists.txt2
-rw-r--r--include/ouroboros/wrap/CMakeLists.txt76
-rw-r--r--include/ouroboros/wrap/ouroboros.i48
3 files changed, 0 insertions, 126 deletions
diff --git a/include/ouroboros/CMakeLists.txt b/include/ouroboros/CMakeLists.txt
index fe0ccf5d..8f248710 100644
--- a/include/ouroboros/CMakeLists.txt
+++ b/include/ouroboros/CMakeLists.txt
@@ -22,5 +22,3 @@ set(HEADER_FILES
)
install(FILES ${HEADER_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ouroboros)
-
-add_subdirectory(wrap)
diff --git a/include/ouroboros/wrap/CMakeLists.txt b/include/ouroboros/wrap/CMakeLists.txt
deleted file mode 100644
index 4b4af98e..00000000
--- a/include/ouroboros/wrap/CMakeLists.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-include_directories(${CMAKE_SOURCE_DIR}/include)
-include_directories(${CMAKE_BINARY_DIR}/include)
-
-find_package(SWIG QUIET)
-if (NOT SWIG_FOUND)
- message(STATUS "Install SWIG to enable bindings for other languages")
-else ()
- set(DISABLE_SWIG TRUE CACHE BOOL "Disable SWIG support")
- if (NOT DISABLE_SWIG)
- message(STATUS "SWIG support enabled")
- include(${SWIG_USE_FILE})
- include_directories(${CMAKE_CURRENT_SOURCE_DIR})
- set(CMAKE_SWIG_FLAGS "")
-
- find_package(PythonInterp QUIET)
- find_package(PythonLibs QUIET)
- if (NOT PYTHONLIBS_FOUND OR NOT PYTHONINTERP_FOUND)
- message(STATUS "Python not found: Python bindings will not be built")
- else ()
- message(STATUS "Python found: Python bindings will be built")
- include_directories(${PYTHON_INCLUDE_PATH})
-
- # CMake > 3.8 deprecates swig_add_module
- if (${CMAKE_VERSION} VERSION_LESS 3.8.0)
- swig_add_module(ouroboros python ouroboros.i)
- else ()
- swig_add_library(ouroboros
- LANGUAGE python
- SOURCES ouroboros.i
- TYPE MODULE)
- endif()
-
- # Python assumes C99 since Python 3.6
- # SWIG generates code for varargs with an unused parameter
- # SWIG generates code with unsafe strncpy()
- set_target_properties(ouroboros PROPERTIES
- COMPILE_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wno-unused-parameter -Wno-stringop-truncation")
- swig_link_libraries(ouroboros ${PYTHON_LIBRARIES} ouroboros-common
- ouroboros-dev ouroboros-irm)
-
- # Installation directives
- if (CMAKE_INSTALL_PREFIX STREQUAL "")
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c
- "from distutils import sysconfig; print(sysconfig.get_python_lib())"
- OUTPUT_VARIABLE PYTHON_MODULE_PATH
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- else ()
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} -c
- "from distutils import sysconfig; print(sysconfig.get_python_lib(plat_specific=True, prefix='${CMAKE_INSTALL_PREFIX}'))"
- OUTPUT_VARIABLE _ABS_PYTHON_MODULE_PATH
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- get_filename_component(_ABS_PYTHON_MODULE_PATH
- ${_ABS_PYTHON_MODULE_PATH} ABSOLUTE)
- file(RELATIVE_PATH PYTHON_MODULE_PATH
- ${CMAKE_INSTALL_PREFIX} ${_ABS_PYTHON_MODULE_PATH})
- endif ()
-
- if (${CMAKE_VERSION} VERSION_LESS "3.13")
- install (
- ${CMAKE_CURRENT_BINARY_DIR}/${SWIG_MODULE_${ouroboros}_REAL_NAME}.so
- DESTINATION ${PYTHON_MODULE_PATH})
- else ()
- install (TARGETS ouroboros
- DESTINATION ${PYTHON_MODULE_PATH})
- endif ()
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ouroboros.py
- DESTINATION ${PYTHON_MODULE_PATH})
- endif ()
- else ()
- message(STATUS "SWIG support disabled")
- endif ()
-endif ()
-
-mark_as_advanced(SWIG_EXECUTABLE)
diff --git a/include/ouroboros/wrap/ouroboros.i b/include/ouroboros/wrap/ouroboros.i
deleted file mode 100644
index 1d93e42b..00000000
--- a/include/ouroboros/wrap/ouroboros.i
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Ouroboros - Copyright (C) 2016 - 2019
- *
- * SWIG wrapper file
- *
- * Dimitri Staessens <[email protected]>
- * Sander Vrijders <[email protected]>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., http://www.fsf.org/about/contact/.
- */
-
-%module ouroboros
-%{
-#include "ouroboros/cdefs.h"
-#include "ouroboros/cacep.h"
-#include "ouroboros/dev.h"
-#include "ouroboros/errno.h"
-#include "ouroboros/fccntl.h"
-#include "ouroboros/fqueue.h"
-#include "ouroboros/irm.h"
-#include "ouroboros/ipcp.h"
-#include "ouroboros/qos.h"
-#include "ouroboros/version.h"
-%}
-
-typedef int pid_t;
-
-%include "ouroboros/cdefs.h"
-%include "ouroboros/cacep.h"
-%include "ouroboros/dev.h"
-%include "ouroboros/errno.h"
-%include "ouroboros/fccntl.h"
-%include "ouroboros/fqueue.h"
-%include "ouroboros/irm.h"
-%include "ouroboros/ipcp.h"
-%include "ouroboros/qos.h"
-%include "ouroboros/version.h"