Skip to content

Commit

Permalink
Merge pull request #75 from adworacz/armMeson
Browse files Browse the repository at this point in the history
Add ARM/AARCH64 building support to Meson build script.
  • Loading branch information
Stefan-Olt authored Jul 21, 2024
2 parents c455fbe + 2447352 commit a81d5b5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
27 changes: 22 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,13 @@ debug_build = get_option('buildtype').startswith('debug')
host_cpu_family = host_machine.cpu_family()

if host_cpu_family == 'x86'
host_x86_bits = 32
host_bits = 32
elif host_cpu_family == 'x86_64'
host_x86_bits = 64
host_bits = 64
elif host_cpu_family == 'arm'
host_bits = 32
elif host_cpu_family == 'aarch64'
host_bits = 64
endif


Expand All @@ -87,19 +91,20 @@ if host_system == 'windows' or host_system == 'cygwin'
nasm_flags += '-DPREFIX'
endif

nasm_flags += ['-f', 'win@0@'.format(host_x86_bits)]
nasm_flags += ['-f', 'win@0@'.format(host_bits)]
elif host_system == 'linux' or host_system == 'bsd' # The BSDs are close enough, right?
if debug_build
nasm_flags += '-gdwarf'
endif

nasm_flags += ['-f', 'elf@0@'.format(host_x86_bits)]
nasm_flags += ['-f', 'elf@0@'.format(host_bits)]
elif host_system == 'darwin'
if debug_build
nasm_flags += '-gdwarf'
endif

nasm_flags += ['-DPREFIX', '-f', 'macho@0@'.format(host_x86_bits)]
nasm_flags += ['-DPREFIX', '-f', 'macho@0@'.format(host_bits)]
cflags += ['-DPREFIX']
else
error('Unknown host system "@0@".'.format(host_system))
endif
Expand Down Expand Up @@ -160,6 +165,18 @@ if host_cpu_family.startswith('x86')
install: false)
endif

if host_cpu_family.startswith('arm') or host_cpu_family.startswith('aarch64')
cflags += ['-DMVTOOLS_ARM=1']

if host_cpu_family.startswith('aarch64')
asm_sources = [
'src/asm/aarch64-pixel-a.S',
]

sources += asm_sources
endif
endif


cxx = meson.get_compiler('cpp')

Expand Down
5 changes: 2 additions & 3 deletions readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ FFTW3 configured for 32 bit floats is required ("fftw3f").

::

mkdir build; cd build
meson ../
ninja
meson setup build
ninja -C build

Or

Expand Down

0 comments on commit a81d5b5

Please sign in to comment.