Skip to content
Permalink
Browse files

Generate simpleservo.h

  • Loading branch information...
paulrouget committed Feb 15, 2019
1 parent d029b1a commit 792ed8a5663c4e96f3a667a780e5bad55e396a64
Showing with 38 additions and 0 deletions.
  1. +17 −0 Cargo.lock
  2. +3 −0 ports/libsimpleservo/capi/Cargo.toml
  3. +18 −0 ports/libsimpleservo/capi/build.rs

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -17,6 +17,9 @@ simpleservo = { path = "../api" }
log = "0.4"
env_logger = "0.6"

[build-dependencies]
cbindgen = "0.8"

[features]
default = ["unstable", "default-except-unstable"]
default-except-unstable = ["webdriver", "max_log_level"]
@@ -0,0 +1,18 @@
/* 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 std::env;

fn main() {
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let target_dir = env::var("CARGO_TARGET_DIR").unwrap();
let profile_dir = env::var("PROFILE").unwrap();
let dest = format!("{}/{}/{}", target_dir, profile_dir, "simpleservo.h");
cbindgen::Builder::new()
.with_crate(crate_dir)
.with_language(cbindgen::Language::C)
.generate()
.expect("Unable to generate bindings")
.write_to_file(dest);
}

0 comments on commit 792ed8a

Please sign in to comment.
You can’t perform that action at this time.