diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index a80ff7ac25..d2cea2d606 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1543,7 +1543,8 @@ 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", + "build.rustflags=['#{Hardware::CPU.rustflags_target_cpu}']"] end # Standard parameters for CMake builds.