26 lines
497 B
Ruby
26 lines
497 B
Ruby
# typed: false
|
|
# frozen_string_literal: true
|
|
|
|
# TODO: (3.2) remove this module when the linked deprecated functions are removed.
|
|
|
|
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
|