From f82953e8cbcc8187c9d0c1fff723c66704f8cf5a Mon Sep 17 00:00:00 2001 From: luckychess Date: Wed, 20 Dec 2017 23:46:47 +0300 Subject: [PATCH] Add Swig bindings for C#. Signed-off-by: luckychess --- CMakeLists.txt | 2 ++ shared_model/bindings/CMakeLists.txt | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c04d6f7825..69a0aa6f7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,7 @@ option(PACKAGE_DEB "Create DEB package" OFF) option(ENABLE_LIBS_PACKAGING "Enable libs packaging" ON) option(SWIG_PYTHON "Generate Swig Python bindings" OFF) option(SWIG_JAVA "Generate Swig Java bindings" OFF) +option(SWIG_CSHARP "Generate Swig C# bindings" OFF) if (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE Debug) @@ -67,6 +68,7 @@ message(STATUS "-DPACKAGE_DEB=${PACKAGE_DEB}") message(STATUS "-DENABLE_LIBS_PACKAGING=${ENABLE_LIBS_PACKAGING}") message(STATUS "-DSWIG_PYTHON=${SWIG_PYTHON}") message(STATUS "-DSWIG_JAVA=${SWIG_JAVA}") +message(STATUS "-DSWIG_CSHARP=${SWIG_CSHARP}") SET(IROHA_SCHEMA_DIR "${PROJECT_SOURCE_DIR}/schema") include_directories( diff --git a/shared_model/bindings/CMakeLists.txt b/shared_model/bindings/CMakeLists.txt index bee439fa28..02daa900b4 100644 --- a/shared_model/bindings/CMakeLists.txt +++ b/shared_model/bindings/CMakeLists.txt @@ -26,7 +26,7 @@ target_link_libraries(bindings -if (SWIG_PYTHON OR SWIG_JAVA) +if (SWIG_PYTHON OR SWIG_JAVA OR SWIG_CSHARP) find_package(SWIG 3.0.12 REQUIRED) include(${SWIG_USE_FILE}) @@ -58,3 +58,8 @@ if (SWIG_JAVA) swig_add_library(iroha LANGUAGE java SOURCES bindings.i) swig_link_libraries(iroha ${Java_LIBRARIES} bindings) endif() + +if (SWIG_CSHARP) + swig_add_library(libirohacs LANGUAGE csharp SOURCES bindings.i) + swig_link_libraries(libirohacs bindings) +endif()