mirror of
https://github.com/servo/servo.git
synced 2025-08-25 07:08:21 +01:00
Auto merge of #22844 - paulrouget:capi-header, r=SimonSapin
Generate simpleservo.h Fix #22834 Waiting on https://github.com/eqrion/cbindgen/pull/271 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22844) <!-- Reviewable:end -->
This commit is contained in:
commit
710271f070
3 changed files with 38 additions and 0 deletions
|
@ -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"]
|
||||
|
|
18
ports/libsimpleservo/capi/build.rs
Normal file
18
ports/libsimpleservo/capi/build.rs
Normal file
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue