diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2019-12-07 12:34:17 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2019-12-08 10:03:36 +0100 |
commit | e87a839c128b30651a354693d7dd40ce9fa3921f (patch) | |
tree | 1cf700c16ea9bf15c3c137acceabe8c6e51ed33d /include/ouroboros/wrap/CMakeLists.txt | |
parent | 80eb05876f302ef713556637a54bf82c00506139 (diff) | |
download | ouroboros-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 <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'include/ouroboros/wrap/CMakeLists.txt')
-rw-r--r-- | include/ouroboros/wrap/CMakeLists.txt | 76 |
1 files changed, 0 insertions, 76 deletions
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) |