From c89b1acb6e5d5755dc79c1f5643c915624a4c4c3 Mon Sep 17 00:00:00 2001 From: syn Date: Tue, 19 May 2020 20:54:45 +0300 Subject: Some kind of working code --- build.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 build.rs (limited to 'build.rs') 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()); +} -- cgit v1.2.1-18-gbd029