Initial repo
This commit is contained in:
17
crates/bindings/Cargo.toml
Normal file
17
crates/bindings/Cargo.toml
Normal file
@ -0,0 +1,17 @@
|
||||
[package]
|
||||
edition = "2021"
|
||||
name = "bindings"
|
||||
version = "0.0.0"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
napi = {version = "2", default-features = false, features = ["napi4"]}
|
||||
napi-derive = "2"
|
||||
|
||||
[build-dependencies]
|
||||
napi-build = "2"
|
||||
|
||||
[profile.release]
|
||||
lto = true
|
5
crates/bindings/build.rs
Normal file
5
crates/bindings/build.rs
Normal file
@ -0,0 +1,5 @@
|
||||
extern crate napi_build;
|
||||
|
||||
fn main() {
|
||||
napi_build::setup();
|
||||
}
|
8
crates/bindings/src/lib.rs
Normal file
8
crates/bindings/src/lib.rs
Normal file
@ -0,0 +1,8 @@
|
||||
#![deny(clippy::all)]
|
||||
|
||||
use napi_derive::napi;
|
||||
|
||||
#[napi]
|
||||
pub fn sum(a: i32, b: i32) -> i32 {
|
||||
a + b
|
||||
}
|
Reference in New Issue
Block a user