-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(avc): support using env to specify static libs location
- Loading branch information
Showing
1 changed file
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
use std::path::Path; | ||
|
||
fn main() { | ||
let lib_path = format!("{}/static-lib/{}", std::env::var("CARGO_MANIFEST_DIR").unwrap(), std::env::var("TARGET").unwrap()); | ||
println!("cargo:rustc-link-search={lib_path}"); | ||
let libs_dir = std::env::var("PRPR_AVC_LIBS").unwrap_or_else(|_| format!("{}/static-lib", std::env::var("CARGO_MANIFEST_DIR").unwrap())); | ||
let libs_path = Path::new(&libs_dir).join(std::env::var("TARGET").unwrap()); | ||
let libs_path = libs_path.display(); | ||
println!("cargo:rustc-link-search={libs_path}"); | ||
println!("cargo:rustc-link-lib=z"); | ||
println!("cargo:rerun-if-changed={lib_path}"); | ||
println!("cargo:rerun-if-changed={libs_path}"); | ||
} |
0133ef4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
啊卧槽终于支持这个了,之前被这玩意儿坑惨了,看了build.rs才看明白