-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Fixed incorrect use of cfg! macro and update build.rs to suppo…
…rt arm target (#1458) What I've done Fixed incorrect use of cfg! macro use the CARGO_CFG_TARGET_<OS/ARCH> macro instead of the original cfg! (target_<os/arch>) This is because The build script is compiled for the host architecture as a separate build phase, as that's where it runs. Since the cfg macro runs at compile time it'll always report the host configuration there.When cargo runs the build script it passes the configuration through environment variables, one of which is CARGO_CFG_TARGET_ARCH. Some dicussions can be found here update build.rs to support arm target support arm target. Like the Aarch64 target, we need to additionally install the cross-compilation toolchain and specify the linker in Cargo/config.toml. I can add this part of the work in next pull request if necessary. Co-authored-by: Matt Mastracci <[email protected]>
- Loading branch information
Showing
2 changed files
with
80 additions
and
68 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
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,3 +1,12 @@ | ||
[toolchain] | ||
channel = "1.77.2" | ||
components = ["rustfmt", "clippy"] | ||
targets = [ | ||
"x86_64-apple-darwin", | ||
"aarch64-apple-darwin", | ||
"x86_64-unknown-linux-gnu", | ||
"aarch64-unknown-linux-gnu", | ||
"x86_64-pc-windows-msvc", | ||
"aarch64-linux-android", | ||
"x86_64-linux-android", | ||
] |