Skip to content

Commit

Permalink
Merge pull request #43 from dojoengine/fix-deploy-burner
Browse files Browse the repository at this point in the history
feat: fix starknet & big refactor on bindings
  • Loading branch information
Larkooo authored Aug 8, 2024
2 parents 835aeb2 + 5567807 commit 582c791
Show file tree
Hide file tree
Showing 9 changed files with 1,484 additions and 856 deletions.
668 changes: 339 additions & 329 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ cainome = { git = "https://github.com/cartridge-gg/cainome", tag = "v0.3.0" }
[target.'cfg(target_arch = "wasm32")'.dependencies]
serde-wasm-bindgen = "0.6.3"
wasm-bindgen-futures = "0.4.39"
tsify = "0.4.5"
js-sys = "0.3.66"
web-sys = { version = "0.3.4", features = [
'MessageEvent',
Expand All @@ -46,6 +45,7 @@ web-sys = { version = "0.3.4", features = [
'console',
] }
crypto-bigint = "0.5.5"
tsify-next = { version = "0.5.4", features = ["js"] }

[build-dependencies]
cbindgen = "0.26.0"
Expand Down
35 changes: 35 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,41 @@ fn main() {
.expect("Unable to generate bindings")
.write_to_file("dojo.hpp");

cbindgen::Builder::new()
.with_config({
let mut config = cbindgen::Config::default();

config.language = cbindgen::Language::Cython;
config.braces = cbindgen::Braces::SameLine;
config.style = cbindgen::Style::Both;
config.layout = cbindgen::LayoutConfig { ..Default::default() };
config.enumeration = cbindgen::EnumConfig {
derive_helper_methods: true,
// prefix_with_name: true,
..Default::default()
};
config.export = cbindgen::ExportConfig {
mangle: cbindgen::MangleConfig { remove_underscores: true, ..Default::default() },
..Default::default()
};

// config.structure.derive_constructor = true;
// config.structure.derive_eq = true;
config.namespace = Some("dojo_bindings".to_string());

config.defines = HashMap::new();
config.defines.insert(
"target_pointer_width = 32".to_string(),
"TARGET_POINTER_WIDTH_32".to_string(),
);

config
})
.with_crate(crate_dir.clone())
.generate()
.expect("Unable to generate bindings")
.write_to_file("dojo.pyx");

// NOTE: disable for now. use c2cs to generate csharp bindings
// generics not supported
// csbindgen::Builder::default()
Expand Down
Loading

0 comments on commit 582c791

Please sign in to comment.