-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set XLA_EXTENSION_DIR on build for xla-rs to read
- Loading branch information
1 parent
7820c67
commit 74b7259
Showing
3 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use std::env; | ||
use std::path::PathBuf; | ||
|
||
fn main() { | ||
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("Missing manifest"); | ||
let xla_extension_dir = PathBuf::from(manifest_dir).join("xla_extension"); | ||
|
||
if !xla_extension_dir.exists() { | ||
panic!("The xla_extension library was not found in the expected path: {}", xla_extension_dir.display()); | ||
} | ||
println!("cargo:rustc-env=XLA_EXTENSION_DIR={}", xla_extension_dir.display()); | ||
println!("cargo:rerun-if-changed=build.rs"); | ||
} |