Skip to content
Snippets Groups Projects
Commit 90c25bf9 authored by Caleb Xu's avatar Caleb Xu
Browse files

std: use HOMEBREW_ARCH env var on Linux

Unlike macOS, Linux installations can be installed/deployed on a
variety of hardware. The HOMEBREW_ARCH environment variable
allows the end user to set a custom -march=... option for the
compiler. If the variable is not set, it defaults to "native".

This only applies on Linux; on macOS, behavior remains unchanged.
parent 88bf60d5
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,8 @@ module Stdenv
# @private
SAFE_CFLAGS_FLAGS = "-w -pipe".freeze
DEFAULT_FLAGS = "-march=core2 -msse4".freeze
HOMEBREW_ARCH = (ENV["HOMEBREW_ARCH"] || "native").freeze
DEFAULT_FLAGS = (OS.mac? ? "-march=core2 -msse4" : "-march=#{HOMEBREW_ARCH}").freeze
# @private
def setup_build_environment(formula = nil)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment