Skip to content

Commit

Permalink
refactor: small changes and add headers
Browse files Browse the repository at this point in the history
  • Loading branch information
algebraic-dev committed Feb 14, 2024
1 parent 1f398ba commit 20c29d5
Show file tree
Hide file tree
Showing 16 changed files with 1,881 additions and 3,482 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "permissionless-arbitration/contracts/lib/forge-std"]
path = permissionless-arbitration/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "machine-bindings/cartesi-machine-sys/machine-emulator"]
path = machine-bindings/cartesi-machine-sys/machine-emulator
url = https://github.com/cartesi/machine-emulator.git
21 changes: 0 additions & 21 deletions machine-bindings/Cargo.lock

This file was deleted.

4 changes: 4 additions & 0 deletions machine-bindings/cartesi-machine-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]


[build-dependencies]
bindgen = "0.65.1"
3 changes: 2 additions & 1 deletion machine-bindings/cartesi-machine-sys/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# cartesi-machine-sys

This crate offers native bindings for the [cartesi emulator](https://github.com/cartesi/machine-emulator), enabling local manipulation of a Cartesi machine.
This crate offers native bindings for the [cartesi emulator](https://github.com/cartesi/machine-emulator), enabling local manipulation of a Cartesi machine.

12 changes: 12 additions & 0 deletions machine-bindings/cartesi-machine-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
use std::{env, path::PathBuf};

fn main() {
println!("cargo:rustc-link-lib=cartesi");

let bindings = bindgen::Builder::default()
.header("src/headers/machine-c-api.h")
.generate()
.expect("Unable to generate bindings");

let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
Loading

0 comments on commit 20c29d5

Please sign in to comment.