-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(next-swc): embed target triple string
- Loading branch information
Showing
4 changed files
with
35 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,5 +1,23 @@ | ||
use std::{ | ||
env, | ||
fs::File, | ||
io::{BufWriter, Write}, | ||
path::Path, | ||
}; | ||
|
||
extern crate napi_build; | ||
|
||
fn main() { | ||
let out_dir = env::var("OUT_DIR").expect("Outdir should exist"); | ||
let dest_path = Path::new(&out_dir).join("triple.txt"); | ||
let mut f = | ||
BufWriter::new(File::create(&dest_path).expect("Failed to create target triple text")); | ||
write!( | ||
f, | ||
"{}", | ||
env::var("TARGET").expect("Target should be specified") | ||
) | ||
.expect("Failed to write target triple text"); | ||
|
||
napi_build::setup(); | ||
} |
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
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