hardware: use Nehalem flags on >= Sierra.
See https://en.wikipedia.org/wiki/MacOS_Sierra#System_requirements.
This commit is contained in:
parent
e6e534157c
commit
04fbdce3bb
@ -1,4 +1,5 @@
|
||||
if OS.mac?
|
||||
require "extend/os/mac/hardware"
|
||||
require "extend/os/mac/hardware/cpu"
|
||||
elsif OS.linux?
|
||||
require "extend/os/linux/hardware/cpu"
|
||||
|
9
Library/Homebrew/extend/os/mac/hardware.rb
Normal file
9
Library/Homebrew/extend/os/mac/hardware.rb
Normal file
@ -0,0 +1,9 @@
|
||||
module Hardware
|
||||
def self.oldest_cpu
|
||||
if MacOS.version >= :sierra
|
||||
:nehalem
|
||||
else
|
||||
generic_oldest_cpu
|
||||
end
|
||||
end
|
||||
end
|
@ -7,6 +7,7 @@ module Hardware
|
||||
|
||||
class << self
|
||||
OPTIMIZATION_FLAGS = {
|
||||
nehalem: "-march=nehalem -msse4.2",
|
||||
core2: "-march=core2",
|
||||
core: "-march=prescott",
|
||||
armv6: "-march=armv6",
|
||||
@ -130,7 +131,8 @@ module Hardware
|
||||
end
|
||||
end
|
||||
|
||||
def self.cores_as_words
|
||||
class << self
|
||||
def cores_as_words
|
||||
case Hardware::CPU.cores
|
||||
when 1 then "single"
|
||||
when 2 then "dual"
|
||||
@ -143,7 +145,7 @@ module Hardware
|
||||
end
|
||||
end
|
||||
|
||||
def self.oldest_cpu
|
||||
def oldest_cpu
|
||||
if Hardware::CPU.intel?
|
||||
if Hardware::CPU.is_64_bit?
|
||||
:core2
|
||||
@ -160,6 +162,8 @@ module Hardware
|
||||
Hardware::CPU.family
|
||||
end
|
||||
end
|
||||
alias generic_oldest_cpu oldest_cpu
|
||||
end
|
||||
end
|
||||
|
||||
require "extend/os/hardware"
|
||||
|
Loading…
x
Reference in New Issue
Block a user