diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2019-03-16 16:24:19 +0100 |
---|---|---|
committer | Sander Vrijders <sander@ouroboros.rocks> | 2019-03-18 11:09:31 +0100 |
commit | 827ed1287fce61ccf4de2931bc7f477099976e2e (patch) | |
tree | 10a8e79bf4393b03c90038de4a5c424a42f9fa0b | |
parent | 8940fe2cc063d2de8393684ff48efec0e27edc8a (diff) | |
download | ouroboros-827ed1287fce61ccf4de2931bc7f477099976e2e.tar.gz ouroboros-827ed1287fce61ccf4de2931bc7f477099976e2e.zip |
build: Fix build error with swig
There is an unsafe strncpy() in the swig compilation process, which
has been fixed a while back but is still not in the release
version. This disables the compiler warning. It also fixes an
unspecified option.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | include/ouroboros/wrap/CMakeLists.txt | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 24e025d4..5bf234d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,5 @@ cmake_minimum_required(VERSION 2.8.12.2) +cmake_policy(VERSION 3.13) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") diff --git a/include/ouroboros/wrap/CMakeLists.txt b/include/ouroboros/wrap/CMakeLists.txt index abcd1cec..9a5e1075 100644 --- a/include/ouroboros/wrap/CMakeLists.txt +++ b/include/ouroboros/wrap/CMakeLists.txt @@ -5,7 +5,7 @@ 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") + set(DISABLE_SWIG FALSE CACHE BOOL "Disable SWIG support") if (NOT DISABLE_SWIG) message(STATUS "SWIG support enabled") include(${SWIG_USE_FILE}) @@ -24,7 +24,8 @@ else () test_and_set_c_compiler_flag_global(-std=c99) # SWIG generates code for varargs with an unused parameter test_and_set_c_compiler_flag_global(-Wno-unused-parameter) - + # SWIG generates code with unsafe strncpy() + test_and_set_c_compiler_flag_global(-Wno-stringop-truncation) # CMake > 3.8 deprecates swig_add_module if (${CMAKE_VERSION} VERSION_LESS 3.8.0) swig_add_module(ouroboros python ouroboros.i) @@ -58,7 +59,7 @@ else () endif () install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${SWIG_MODULE_ouroboros_REAL_NAME}.so + ${CMAKE_CURRENT_BINARY_DIR}/_${SWIG_MODULE_ouroboros_REAL_NAME}.so DESTINATION ${PYTHON_MODULE_PATH}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ouroboros.py DESTINATION ${PYTHON_MODULE_PATH}) |