-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
16 lines (14 loc) · 820 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fs;
fn main() {
let path =
"cc13xx_cc26xx_sdk/source/ti/devices/cc13x2_cc26x2/driverlib/bin/ticlang/driverlib.lib";
// Note that lld (default rust linker) will assume .a as exetension and prefix with lib. So the format is lib{name}.a
// ref: https://releases.llvm.org/2.5/docs/CommandGuide/html/llvm-ld.html
// Give the mule what he wants
let copy_path = "target/libdriverlib.a";
// Copy the library to the target directory so as to not dirty the submodule
fs::copy(path, copy_path).expect("Didn't find driverlib, have you run `git submodule add [email protected]:TexasInstruments/cc13xx_cc26xx_sdk.git`?");
// Tell cargo to tell rustc to link the driverlib library.
println!("cargo:rustc-link-search=target");
println!("cargo:rustc-link-lib=static=driverlib");
}