Skip to content

Commit 371c0ec

Browse files
committed
add template cbindgen.toml
1 parent b1de604 commit 371c0ec

File tree

3 files changed

+145
-0
lines changed

3 files changed

+145
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ See `cbindgen --help` for more options.
5454

5555
[Read the full user docs here!](docs.md)
5656

57+
[Get a template cbindgen.toml here.](template.toml)
5758

5859

5960

docs.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ cbindgen --config cbindgen.toml --crate my_rust_library --output my_header.h`
3838

3939
See `cbindgen --help` for more options.
4040

41+
[Get a template cbindgen.toml here.](template.toml)
42+
4143

4244

4345
## build.rs

template.toml

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
# This is a template cbindgen.toml file with all of the default values.
2+
# Some values are commented out because their absence is the real default.
3+
#
4+
# See https://github.com/eqrion/cbindgen/blob/master/docs.md#cbindgentoml
5+
# for detailed documentation of every option here.
6+
7+
8+
9+
language = "C++"
10+
11+
12+
13+
############## Options for Wrapping the Contents of the Header #################
14+
15+
# header = "/* Text to put at the beginning of the generated file. Probably a license. */"
16+
# trailer = "/* Text to put at the end of the generated file */"
17+
# include_guard = "my_bindings_h"
18+
# autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
19+
include_version = false
20+
# namespace = "my_namespace"
21+
namespaces = []
22+
sys_includes = []
23+
includes = []
24+
no_includes = false
25+
26+
27+
28+
29+
############################ Code Style Options ################################
30+
31+
braces = "SameLine"
32+
line_length = 100
33+
tab_width = 2
34+
documentation_style = "auto"
35+
36+
37+
38+
39+
40+
############################# Codegen Options ##################################
41+
42+
style = "both"
43+
44+
45+
46+
[defines]
47+
# "target_os = freebsd" = "DEFINE_FREEBSD"
48+
# "feature = serde" = "DEFINE_SERDE"
49+
50+
51+
52+
[export]
53+
include = []
54+
exclude = []
55+
# prefix = "CAPI_"
56+
item_types = []
57+
renaming_overrides_prefixing = false
58+
59+
60+
61+
[export.rename]
62+
63+
64+
65+
[export.body]
66+
67+
68+
69+
70+
[fn]
71+
rename_args = "None"
72+
# must_use = "MUST_USE_FUNC"
73+
# prefix = "START_FUNC"
74+
# postfix = "END_FUNC"
75+
args = "auto"
76+
77+
78+
79+
80+
[struct]
81+
rename_fields = "None"
82+
# must_use = "MUST_USE_STRUCT"
83+
derive_constructor = false
84+
derive_eq = false
85+
derive_neq = false
86+
derive_lt = false
87+
derive_lte = false
88+
derive_gt = false
89+
derive_gte = false
90+
91+
92+
93+
94+
[enum]
95+
rename_variants = "None"
96+
# must_use = "MUST_USE_ENUM"
97+
add_sentinel = false
98+
prefix_with_name = false
99+
derive_helper_methods = false
100+
derive_const_casts = false
101+
derive_mut_casts = false
102+
# cast_assert_name = "ASSERT"
103+
derive_tagged_enum_destructor = false
104+
derive_tagged_enum_copy_constructor = false
105+
106+
107+
108+
109+
[const]
110+
allow_static_const = true
111+
112+
113+
114+
115+
[macro_expansion]
116+
bitflags = false
117+
118+
119+
120+
121+
122+
123+
############## Options for How Your Rust library Should Be Parsed ##############
124+
125+
[parse]
126+
parse_deps = false
127+
# include = []
128+
exclude = []
129+
clean = false
130+
131+
132+
133+
[parse.expand]
134+
crates = []
135+
all_features = false
136+
default_features = true
137+
features = []
138+
139+
140+
141+
142+

0 commit comments

Comments
 (0)