ci(workflows): added RUSTFLAGS configuration for x86-64-v3 CPU optimization in CI and native builds

- Added RUSTFLAGS environment variable configuration to CI workflow for x86-64-v3 CPU optimization across multiple build jobs.
- Added per-matrix rustflags configuration for native builds on x64 platforms (Linux, macOS Intel, Windows).
- Updated build-native script to default to native CPU optimization for local builds when not cross-compiling.
This commit is contained in:
can1357
2026-02-10 22:06:34 +01:00
parent 336963b815
commit 148f9e883d
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -15,6 +15,11 @@ const isCrossCompile =
targetPlatform !== process.platform ||
targetArch !== process.arch;
// Default to native CPU optimization for local builds; CI overrides via RUSTFLAGS env
if (!isCrossCompile && !Bun.env.RUSTFLAGS) {
Bun.env.RUSTFLAGS = "-C target-cpu=native";
}
async function cleanupStaleTemps(dir: string): Promise<void> {
try {
const entries = await fs.readdir(dir);