You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.2 KiB
Rust

2 years ago
/*
* 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/.
2 years ago
*/
use cbindgen::{Config, Language};
use std::env;
2 years ago
fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
10 months ago
let mut config = Config::default();
config.cpp_compat = true;
2 years ago
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. */",
)
2 years ago
.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/.
2 years ago
*/"#,
)
2 years ago
.with_documentation(true)
.generate()
.expect("Unable to generate bindings")
.write_to_file("cozo_c.h");
}