-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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 (#35416)
This PR straightly port over swc's target triple metadata (swc-project/swc#4058) into next-swc, mainly for the tracking purpose of usages. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
- 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