Use -march=native for non-bottle source builds [Linux]

This commit is contained in:
Shaun Jackman 2019-01-08 09:39:37 -08:00
parent 5e6e673ec5
commit 23ea066a0f
3 changed files with 16 additions and 1 deletions

View File

@ -1 +1,5 @@
require "extend/os/mac/extend/ENV/shared" if OS.mac?
if OS.mac?
require "extend/os/mac/extend/ENV/shared"
elsif OS.linux?
require "extend/os/linux/extend/ENV/shared"
end

View File

@ -0,0 +1,10 @@
module SharedEnvExtension
# @private
def effective_arch
if ARGV.build_bottle?
ARGV.bottle_arch || Hardware.oldest_cpu
else
:native
end
end
end

View File

@ -7,6 +7,7 @@ module Hardware
class << self
OPTIMIZATION_FLAGS = {
native: "-march=native",
nehalem: "-march=nehalem",
penryn: "-march=penryn",
core2: "-march=core2",