Move oldest_cpu to Hardware

This commit is contained in:
Jack Nagel 2013-06-06 16:02:27 -05:00
parent 057ed6b4fb
commit 159b9d8e2d
3 changed files with 13 additions and 13 deletions

View File

@ -328,7 +328,7 @@ module HomebrewEnvExtension
append flags, xarch unless xarch.empty?
if ARGV.build_bottle?
append flags, Hardware::CPU.optimization_flags[MacOS.oldest_cpu]
append flags, Hardware::CPU.optimization_flags[Hardware.oldest_cpu]
else
# Don't set -msse3 and older flags because -march does that for us
append flags, map.fetch(Hardware::CPU.family, default)

View File

@ -45,4 +45,16 @@ class Hardware
Hardware.processor_count
end
end
def self.oldest_cpu
if Hardware::CPU.type == :intel
if Hardware::CPU.is_64_bit?
:core2
else
:core
end
else
Hardware::CPU.family
end
end
end

View File

@ -28,18 +28,6 @@ module MacOS extend self
end
end
def oldest_cpu
if Hardware::CPU.type == :intel
if Hardware::CPU.is_64_bit?
:core2
else
:core
end
else
Hardware::CPU.family
end
end
def locate tool
# Don't call tools (cc, make, strip, etc.) directly!
# Give the name of the binary you look for as a string to this method