1
- use std:: collections:: HashMap ;
2
1
use std:: env;
3
2
4
3
fn main ( ) {
5
4
let crate_dir = env:: var ( "CARGO_MANIFEST_DIR" ) . unwrap ( ) ;
6
5
7
6
cbindgen:: Builder :: new ( )
8
7
. with_config ( {
9
- let mut config = cbindgen:: Config :: default ( ) ;
10
-
11
- config. language = cbindgen:: Language :: C ;
12
- config. braces = cbindgen:: Braces :: SameLine ;
13
- config. cpp_compat = true ;
14
- config. style = cbindgen:: Style :: Both ;
15
- config. layout = cbindgen:: LayoutConfig { ..Default :: default ( ) } ;
16
- config. enumeration = cbindgen:: EnumConfig {
17
- derive_helper_methods : true ,
18
- // prefix_with_name: true,
19
- ..Default :: default ( )
20
- } ;
21
- config. export = cbindgen:: ExportConfig {
22
- mangle : cbindgen:: MangleConfig { remove_underscores : true , ..Default :: default ( ) } ,
8
+ let mut config = cbindgen:: Config {
9
+ language : cbindgen:: Language :: C ,
10
+ braces : cbindgen:: Braces :: SameLine ,
11
+ cpp_compat : true ,
12
+ style : cbindgen:: Style :: Both ,
13
+ layout : cbindgen:: LayoutConfig { ..Default :: default ( ) } ,
14
+ enumeration : cbindgen:: EnumConfig {
15
+ derive_helper_methods : true ,
16
+ // prefix_with_name: true,
17
+ ..Default :: default ( )
18
+ } ,
19
+ export : cbindgen:: ExportConfig {
20
+ mangle : cbindgen:: MangleConfig {
21
+ remove_underscores : true ,
22
+ ..Default :: default ( )
23
+ } ,
24
+ ..Default :: default ( )
25
+ } ,
26
+ namespace : Some ( "dojo_bindings" . to_string ( ) ) ,
23
27
..Default :: default ( )
24
28
} ;
25
29
26
- config. defines = HashMap :: new ( ) ;
27
- // config.defines.insert("target_arch = wasm32".to_string(),
28
- // "TARGET_WASM32".to_string());
29
30
config. defines . insert (
30
31
"target_pointer_width = 32" . to_string ( ) ,
31
32
"TARGET_POINTER_WIDTH_32" . to_string ( ) ,
@@ -40,27 +41,27 @@ fn main() {
40
41
41
42
cbindgen:: Builder :: new ( )
42
43
. with_config ( {
43
- let mut config = cbindgen:: Config :: default ( ) ;
44
-
45
- config. language = cbindgen:: Language :: Cxx ;
46
- config. braces = cbindgen:: Braces :: SameLine ;
47
- config. style = cbindgen:: Style :: Both ;
48
- config. layout = cbindgen:: LayoutConfig { ..Default :: default ( ) } ;
49
- config. enumeration = cbindgen:: EnumConfig {
50
- derive_helper_methods : true ,
51
- // prefix_with_name: true,
52
- ..Default :: default ( )
53
- } ;
54
- config. export = cbindgen:: ExportConfig {
55
- mangle : cbindgen:: MangleConfig { remove_underscores : true , ..Default :: default ( ) } ,
44
+ let mut config = cbindgen:: Config {
45
+ language : cbindgen:: Language :: Cxx ,
46
+ braces : cbindgen:: Braces :: SameLine ,
47
+ style : cbindgen:: Style :: Both ,
48
+ layout : cbindgen:: LayoutConfig { ..Default :: default ( ) } ,
49
+ enumeration : cbindgen:: EnumConfig {
50
+ derive_helper_methods : true ,
51
+ // prefix_with_name: true,
52
+ ..Default :: default ( )
53
+ } ,
54
+ export : cbindgen:: ExportConfig {
55
+ mangle : cbindgen:: MangleConfig {
56
+ remove_underscores : true ,
57
+ ..Default :: default ( )
58
+ } ,
59
+ ..Default :: default ( )
60
+ } ,
61
+ namespace : Some ( "dojo_bindings" . to_string ( ) ) ,
56
62
..Default :: default ( )
57
63
} ;
58
64
59
- // config.structure.derive_constructor = true;
60
- // config.structure.derive_eq = true;
61
- config. namespace = Some ( "dojo_bindings" . to_string ( ) ) ;
62
-
63
- config. defines = HashMap :: new ( ) ;
64
65
config. defines . insert (
65
66
"target_pointer_width = 32" . to_string ( ) ,
66
67
"TARGET_POINTER_WIDTH_32" . to_string ( ) ,
@@ -75,27 +76,27 @@ fn main() {
75
76
76
77
cbindgen:: Builder :: new ( )
77
78
. with_config ( {
78
- let mut config = cbindgen:: Config :: default ( ) ;
79
-
80
- config. language = cbindgen:: Language :: Cython ;
81
- config. braces = cbindgen:: Braces :: SameLine ;
82
- config. style = cbindgen:: Style :: Both ;
83
- config. layout = cbindgen:: LayoutConfig { ..Default :: default ( ) } ;
84
- config. enumeration = cbindgen:: EnumConfig {
85
- derive_helper_methods : true ,
86
- // prefix_with_name: true,
79
+ let mut config = cbindgen:: Config {
80
+ language : cbindgen:: Language :: Cython ,
81
+ braces : cbindgen:: Braces :: SameLine ,
82
+ style : cbindgen:: Style :: Both ,
83
+ layout : cbindgen:: LayoutConfig { ..Default :: default ( ) } ,
84
+ enumeration : cbindgen:: EnumConfig {
85
+ derive_helper_methods : true ,
86
+ // prefix_with_name: true,
87
+ ..Default :: default ( )
88
+ } ,
89
+ export : cbindgen:: ExportConfig {
90
+ mangle : cbindgen:: MangleConfig {
91
+ remove_underscores : true ,
92
+ ..Default :: default ( )
93
+ } ,
94
+ ..Default :: default ( )
95
+ } ,
96
+ namespace : Some ( "dojo_bindings" . to_string ( ) ) ,
87
97
..Default :: default ( )
88
98
} ;
89
- config. export = cbindgen:: ExportConfig {
90
- mangle : cbindgen:: MangleConfig { remove_underscores : true , ..Default :: default ( ) } ,
91
- ..Default :: default ( )
92
- } ;
93
-
94
- // config.structure.derive_constructor = true;
95
- // config.structure.derive_eq = true;
96
- config. namespace = Some ( "dojo_bindings" . to_string ( ) ) ;
97
99
98
- config. defines = HashMap :: new ( ) ;
99
100
config. defines . insert (
100
101
"target_pointer_width = 32" . to_string ( ) ,
101
102
"TARGET_POINTER_WIDTH_32" . to_string ( ) ,
0 commit comments