Skip to content

Commit c344a3f

Browse files
committed
Apply cpu-optimisation to Rust projects (hardcoded)
1 parent 5097876 commit c344a3f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Library/Homebrew/formula.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,7 +1543,11 @@ def std_configure_args
15431543
# Standard parameters for cargo builds.
15441544
sig { params(root: T.any(String, Pathname), path: String).returns(T::Array[T.any(String, Pathname)]) }
15451545
def std_cargo_args(root: prefix, path: ".")
1546-
["--locked", "--root", root, "--path", path]
1546+
["--locked", "--root", root, "--path", path,
1547+
"--config", "target.x86_64-apple-darwin.rustflags=['-Ctarget-cpu=nehalem']",
1548+
"--config", "target.aarch64-apple-darwin.rustflags=['-Ctarget-cpu=apple-m1']",
1549+
# Default target-cpu is apple-m1 since Rust 1.71.0
1550+
]
15471551
end
15481552

15491553
# Standard parameters for CMake builds.

0 commit comments

Comments
 (0)