Merge pull request #7809 from Bo98/macos-version-11

os/mac: fix for major versions other than 10
This commit is contained in:
Bo Anderson 2020-06-23 18:50:58 +01:00 committed by GitHub
commit 9788735eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -52,7 +52,7 @@ module Stdenv
def remove_macosxsdk(version = nil)
# Clear all lib and include dirs from CFLAGS, CPPFLAGS, LDFLAGS that were
# previously added by macosxsdk
remove_from_cflags(/ ?-mmacosx-version-min=10\.\d+/)
remove_from_cflags(/ ?-mmacosx-version-min=\d+\.\d+/)
delete("CPATH")
remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"

View File

@ -21,7 +21,7 @@ module OS
# This can be compared to numerics, strings, or symbols
# using the standard Ruby Comparable methods.
def version
@version ||= Version.new(full_version.to_s[/10\.\d+/])
@version ||= Version.new(full_version.to_s[/^\d+\.\d+/])
end
# This can be compared to numerics, strings, or symbols

View File

@ -188,8 +188,8 @@ class Cmd
when "-Xpreprocessor", "-Xclang"
# used for -Xpreprocessor -fopenmp
args << arg << enum.next
when /-mmacosx-version-min=10\.(\d+)/
arg = "-mmacosx-version-min=10.9" if high_sierra_or_later? && $1.to_i < 9
when /-mmacosx-version-min=(\d+)\.(\d+)/
arg = "-mmacosx-version-min=10.9" if high_sierra_or_later? && $1 == "10" && $2.to_i < 9
args << arg
when "--fast-math"
arg = "-ffast-math" if tool =~ /^clang/