summaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorsyn <isaqtm@gmail.com>2020-05-19 20:54:45 +0300
committersyn <isaqtm@gmail.com>2020-05-19 20:54:45 +0300
commitc89b1acb6e5d5755dc79c1f5643c915624a4c4c3 (patch)
tree2b51d52df177db1b14eb6666236a131356e5452f /build.rs
downloadpert-c89b1acb6e5d5755dc79c1f5643c915624a4c4c3.tar.gz
Some kind of working code
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/build.rs b/build.rs
new file mode 100644
index 0000000..eec334e
--- /dev/null
+++ b/build.rs
@@ -0,0 +1,14 @@
+use std::path::PathBuf;
+use std::env;
+
+fn main() {
+ let crate_root: PathBuf = env::var("CARGO_MANIFEST_DIR").unwrap().into();
+ let tdlib_path: PathBuf = {
+ env::var("TDLIB_LIBRARY_PATH")
+ .map_or_else(
+ |_err| crate_root.join("td/build"),
+ |lib_path| PathBuf::from(lib_path)
+ )
+ };
+ println!("cargo:rustc-link-search={}", tdlib_path.to_string_lossy());
+}