Module: ArchitectureListExtension

Defined in:
Library/Homebrew/os/mac/architecture_list.rb

Instance Method Summary collapse

Instance Method Details

#as_arch_flagsObject



39
40
41
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 39

def as_arch_flags
  collect { |a| "-arch #{a}" }.join(" ")
end

#as_cmake_arch_flagsObject



43
44
45
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 43

def as_cmake_arch_flags
  join(";")
end

#cross_universal?Boolean

Old-style 32-bit PPC/Intel universal, e.g. ppc7400 and i386

Returns:

  • (Boolean)


21
22
23
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 21

def cross_universal?
  intersects_all?(Hardware::CPU::PPC_32BIT_ARCHS, Hardware::CPU::INTEL_32BIT_ARCHS)
end

#fat?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 5

def fat?
  length > 1
end

#intel_universal?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 10

def intel_universal?
  intersects_all?(Hardware::CPU::INTEL_32BIT_ARCHS, Hardware::CPU::INTEL_64BIT_ARCHS)
end

#ppc?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 30

def ppc?
  (Hardware::CPU::PPC_32BIT_ARCHS + Hardware::CPU::PPC_64BIT_ARCHS).any? { |a| include? a }
end

#ppc_universal?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 15

def ppc_universal?
  intersects_all?(Hardware::CPU::PPC_32BIT_ARCHS, Hardware::CPU::PPC_64BIT_ARCHS)
end

#remove_ppc!Object



35
36
37
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 35

def remove_ppc!
  (Hardware::CPU::PPC_32BIT_ARCHS + Hardware::CPU::PPC_64BIT_ARCHS).each { |a| delete a }
end

#universal?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'Library/Homebrew/os/mac/architecture_list.rb', line 26

def universal?
  intel_universal? || ppc_universal? || cross_universal?
end