forked from cozodb/cozo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
39 lines (34 loc) · 1.17 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Copyright 2022, The Cozo Project Authors.
*
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
* If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/.
*/
use cbindgen::{Config, Language};
use std::env;
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let mut config = Config::default();
config.cpp_compat = true;
cbindgen::Builder::new()
.with_config(config)
.with_crate(crate_dir)
.with_language(Language::C)
.with_include_guard("COZO_C_H")
.with_autogen_warning(
"/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */",
)
.with_header(
r#"/*
Copyright 2022, The Cozo Project Authors.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file,
You can obtain one at https://mozilla.org/MPL/2.0/.
*/"#,
)
.with_documentation(true)
.generate()
.expect("Unable to generate bindings")
.write_to_file("cozo_c.h");
}