Crates.io | oo-bindgen |
lib.rs | oo-bindgen |
version | 0.8.7 |
source | src |
created_at | 2022-10-25 20:16:10.93048 |
updated_at | 2024-05-20 19:27:57.776738 |
description | DSL-based binding geneator for C, C++, Java, and C# |
homepage | https://github.com/stepfunc/oo_bindgen/ |
repository | |
max_upload_size | |
id | 697169 |
size | 842,783 |
Object-oriented binding generator for Rust.
Licensed under the terms of the MIT or Apache v2 licenses at your choice.
oo-bindgen
: main library to build an object-oriented representation of your
library.tests
: contains an example foo-ffi
library with the associated
foo-bindings
object-oriented library definition. It builds the same library
in each supported language. Each language has extensive unit tests written to
check that the generated bindings work as expected.A minimal CMakeLists.txt
to compile with a library generated by oo-bindgen is
the following:
cmake_minimum_required(VERSION 3.8)
project(my_awesome_project LANGUAGES C)
# Find the foo library generated by oo-bindgen
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_LIST_DIR}/foo/cmake)
find_package(foo REQUIRED)
# Add your awesome project with a dependency to foo
add_executable(my_awesome_project main.c)
target_link_libraries(my_awesome_project PRIVATE foo)
# Copy the DLL/.so after build
add_custom_command(TARGET my_awesome_project POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:foo> $<TARGET_FILE_DIR:my_awesome_project>
)
nuget sources add -Name my-nuget-feed -Source /my-nuget-feed
.nuget add foo.0.1.0.nupkg -Source /my-nuget-feed
.dotnet add MyAwesomeProject package foo
or add it using Visual Studio interface. It
should add a line in your .csproj
like the following: <PackageReference Include="foo" Version="0.1.0" />
mvn org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file -D"file=foo-0.1.0.jar"
<dependency>
<groupId>io.stepfunc</groupId>
<artifactId>foo</artifactId>
<version>0.1.0</version>
</dependency>