Skip to content

Commit ff7de73

Browse files
committed
Build from source if TF_RUST_BUILD_FROM_SRC environment variable equals "true"
1 parent 1c2a63d commit ff7de73

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tensorflow-sys/build.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ fn main() {
4141
return;
4242
}
4343

44-
if env::consts::ARCH == "x86_64" && (env::consts::OS == "linux" || env::consts::OS == "macos") {
44+
let force_src = match env::var("TF_RUST_BUILD_FROM_SRC") {
45+
Ok(s) => s == "true",
46+
Err(_) => false,
47+
};
48+
if !force_src && env::consts::ARCH == "x86_64" && (env::consts::OS == "linux" || env::consts::OS == "macos") {
4549
install_prebuilt();
4650
} else {
4751
build_from_src();

0 commit comments

Comments
 (0)