ENV: warn_if_universal_binaries_not_supported
Raise an error when attempting to create universal binaries with a GCC that can't do so. Closes Homebrew/homebrew#46630. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
d5de719c2b
commit
8ce81af67a
@ -306,4 +306,10 @@ module SharedEnvExtension
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_for_compiler_universal_support
|
||||
if homebrew_cc =~ GNU_GCC_REGEXP
|
||||
raise "Non-Apple GCC can't build universal binaries"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -269,6 +269,8 @@ module Stdenv
|
||||
end
|
||||
|
||||
def universal_binary
|
||||
check_for_compiler_universal_support
|
||||
|
||||
append_to_cflags Hardware::CPU.universal_archs.as_arch_flags
|
||||
append "LDFLAGS", Hardware::CPU.universal_archs.as_arch_flags
|
||||
|
||||
|
||||
@ -268,6 +268,8 @@ module Superenv
|
||||
end
|
||||
|
||||
def universal_binary
|
||||
check_for_compiler_universal_support
|
||||
|
||||
self["HOMEBREW_ARCHFLAGS"] = Hardware::CPU.universal_archs.as_arch_flags
|
||||
|
||||
# GCC doesn't accept "-march" for a 32-bit CPU with "-arch x86_64"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user