Skip to content

Commit

Permalink
Add Swig bindings for C#.
Browse files Browse the repository at this point in the history
Signed-off-by: luckychess <[email protected]>
  • Loading branch information
luckychess authored and kamilsa committed Dec 27, 2017
1 parent 1bd108a commit f82953e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 6 additions & 1 deletion shared_model/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down Expand Up @@ -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()

0 comments on commit f82953e

Please sign in to comment.