falcon-det-sys 0.1.0

Bindings for the Falcon C implementation
Documentation
// Copyright (c) Jeeyong Um <conr2d@proton.me>
// SPDX-License-Identifier: MIT OR Apache-2.0
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use std::{env, path::PathBuf};

fn main() {
	let dst = cmake::Config::new("falcon").build();

	println!("cargo:rustc-link-search=native={}/build", dst.display());
	println!("cargo:rustc-link-lib=static=falcon_det");

	let bindings = bindgen::Builder::default()
		.header("falcon/include/falcon_det.h")
		.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
		.generate()
		.expect("Unable to generate bindings");

	let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
	bindings
		.write_to_file(out_path.join("bindings.rs"))
		.expect("Couldn't write bindings!");
}