From c344a3ff3dbde3db05edb802d8951924689d1d65 Mon Sep 17 00:00:00 2001 From: Tokarak <63452145+Tokarak@users.noreply.github.com> Date: Tue, 13 Jun 2023 11:35:45 +0100 Subject: [PATCH] Apply cpu-optimisation to Rust projects (hardcoded) --- Library/Homebrew/formula.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index a80ff7ac25..14c710ff31 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1543,7 +1543,11 @@ class Formula # Standard parameters for cargo builds. sig { params(root: T.any(String, Pathname), path: String).returns(T::Array[T.any(String, Pathname)]) } def std_cargo_args(root: prefix, path: ".") - ["--locked", "--root", root, "--path", path] + ["--locked", "--root", root, "--path", path, + "--config", "target.x86_64-apple-darwin.rustflags=['-Ctarget-cpu=nehalem']", + "--config", "target.aarch64-apple-darwin.rustflags=['-Ctarget-cpu=apple-m1']", + # Default target-cpu is apple-m1 since Rust 1.71.0 + ] end # Standard parameters for CMake builds.