meson: Add CONFIG_POINTER_SIZE define

This allows detecting the pointer size of the machine running the code.

Signed-off-by: Mary Guillemard <mary@mary.zone>
This commit is contained in:
Mary Guillemard
2025-01-11 10:17:47 +01:00
parent 1559132492
commit 48e071e04d

View File

@@ -160,6 +160,12 @@ if is_firmware_build and get_option('print_memory_usage')
add_project_link_arguments('-Wl,--print-memory-usage', language: 'c')
endif
# We need to know the size of a pointer for the machine running the code
add_project_link_arguments('-DCONFIG_POINTER_SIZE=@0@'.format(cc_host.sizeof('void *')), language: 'c')
if is_cross_build
add_project_link_arguments('-DCONFIG_POINTER_SIZE=@0@'.format(cc_native.sizeof('void *')), language: 'c', native: true)
endif
subdir('src')
## Black Magic Firmware (BMF) targets