forked from jonas-thiele/zxing-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
32 lines (30 loc) · 873 Bytes
/
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
use cc;
use glob::glob;
use std::path::Path;
fn main() {
let c_api_src_dir = Path::new("c_api/src");
let c_api_sources: Vec<_> = glob(c_api_src_dir.join("*.cpp").to_str().unwrap())
.unwrap()
.map(|x| x.unwrap())
.collect();
let core_src_dir = Path::new("submodules/zxing-cpp/core/src");
let core_sources: Vec<_> = glob(core_src_dir.join("**/*.cpp").to_str().unwrap())
.unwrap()
.map(|x| x.unwrap())
.collect();
cc::Build::new()
.cpp(true)
.flag("-std=c++14")
.include(core_src_dir)
.files(core_sources)
.compile("zxing_core");
cc::Build::new()
.cpp(true)
.flag("-std=c++14")
.flag("-v")
.flag("-g")
.include(c_api_src_dir)
.include(core_src_dir)
.files(c_api_sources)
.compile("zxing_c_api");
}