brew/Library/Homebrew/os/mac/architecture_list.rb

26 lines
497 B
Ruby
Raw Normal View History

2020-10-10 14:16:11 +02:00
# typed: false
# frozen_string_literal: true
2021-02-02 16:19:24 +00:00
# TODO: (3.2) remove this module when the linked deprecated functions are removed.
require "hardware"
2016-04-25 18:00:01 +01:00
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