-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.rs
40 lines (34 loc) · 1.15 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
extern crate nl80211_buildtools;
use std::fs::File;
use nl80211_buildtools::Specification;
fn main() {
use std::env;
let out_dir = env::var("OUT_DIR").unwrap();
let file = File::open("specifications/nl80211_commands.json").unwrap();
match Specification::read(file) {
Ok(spec) => spec.generate(&format!("{}/commands.rs", out_dir)).unwrap(),
Err(error) => {
panic!("Failed to load specification, {}", error);
}
}
let file = File::open("specifications/nl80211_attributes.json").unwrap();
match Specification::read(file) {
Ok(spec) => {
spec.generate(&format!("{}/attributes.rs", out_dir))
.unwrap();
}
Err(error) => {
panic!("Failed to load specification, {}", error);
}
}
let file = File::open("specifications/information_element_id.json").unwrap();
match Specification::read(file) {
Ok(spec) => {
spec.generate(&format!("{}/information_element_ids.rs", out_dir))
.unwrap();
}
Err(error) => {
panic!("Failed to load specification, {}", error);
}
}
}