changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > demo / build.rs

changeset 14: 2bbf5ce73537
parent: 1fedeaa5bfc5
author: ellis <ellis@rwest.io>
date: Tue, 23 May 2023 20:43:02 -0400
permissions: -rw-r--r--
description: rs updates
1 use std::env;
2 use std::fs::create_dir;
3 use std::path::PathBuf;
4 fn main() {
5  let crate_dir: PathBuf = env::var("CARGO_MANIFEST_DIR")
6  .expect("CARGO_MANIFEST_DIR env var is not defined")
7  .into();
8  // let mpk_py = "build.py";
9  let build_dir = crate_dir.join("ffi/");
10  if !build_dir.exists() {
11  create_dir(&build_dir).unwrap();
12  }
13  cbindgen::generate(crate_dir)
14  .expect("Unable to find cbindgen.toml configuration file")
15  .write_to_file(build_dir.join("demo.h"));
16 
17 }