mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
24 lines
413 B
Ruby
24 lines
413 B
Ruby
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
require "hardware"
|
|
|
|
module ArchitectureListExtension
|
|
# @private
|
|
def universal?
|
|
intersects_all?(Hardware::CPU::INTEL_32BIT_ARCHS, Hardware::CPU::INTEL_64BIT_ARCHS)
|
|
end
|
|
|
|
def as_arch_flags
|
|
map { |a| "-arch #{a}" }.join(" ")
|
|
end
|
|
|
|
protected
|
|
|
|
def intersects_all?(*set)
|
|
set.all? do |archset|
|
|
archset.any? { |a| include? a }
|
|
end
|
|
end
|
|
end
|