-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build.rs to set ANTE_STDLIB_DIR (#116)
* Add build.rs Since ANTE_STDLIB_DIR was not set, The compiler crashed when compiling a file other than the project root. So I created a build script that creates the standard library directory and sets ANTE_STDLIB_DIR. * Update mod.rs * Update build.rs * Update build.rs
- Loading branch information
Showing
3 changed files
with
11 additions
and
8 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 |
---|---|---|
|
@@ -3,6 +3,7 @@ name = "ante" | |
version = "0.1.1" | ||
authors = ["Jake Fecher <[email protected]>"] | ||
edition = "2018" | ||
build = "build.rs" | ||
|
||
[lib] | ||
name = "ante" | ||
|
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,9 @@ | ||
use std::env; | ||
|
||
fn main() -> std::io::Result<()> { | ||
if option_env!("ANTE_STDLIB_DIR").is_none() { | ||
let cur_dir = env::current_dir()?; | ||
println!("cargo:rustc-env=ANTE_STDLIB_DIR={}/stdlib", cur_dir.to_str().unwrap()); | ||
} | ||
Ok(()) | ||
} |
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