1 use pkg_config::Config;
2 
main()3 fn main() {
4     // The main linking point with c++ code is the libbluetooth-static.a
5     // These includes all the symbols built via C++ but doesn't include other
6     // links (i.e. pkg-config)
7     println!("cargo:rustc-link-lib=static=bluetooth-static");
8 
9     // A few dynamic links
10     println!("cargo:rustc-link-lib=dylib=flatbuffers");
11     println!("cargo:rustc-link-lib=dylib=protobuf");
12     println!("cargo:rustc-link-lib=dylib=resolv");
13 
14     // Clang requires -lc++ instead of -lstdc++
15     println!("cargo:rustc-link-lib=c++");
16 
17     // A few more dependencies from pkg-config. These aren't included as part of
18     // the libbluetooth-static.a
19     Config::new().probe("libchrome").unwrap();
20     Config::new().probe("libmodp_b64").unwrap();
21     Config::new().probe("tinyxml2").unwrap();
22 
23     println!("cargo:rerun-if-changed=build.rs");
24     println!("cargo:rerun-if-changed=libbluetooth-static.a");
25 }
26