meson: fix false positive detection of memfd_create

Add the arguments to `has_function` to properly detect availability of the
function on SDK environments.
This commit is contained in:
Shogo Yamazaki 2024-08-07 14:12:13 +09:00 committed by Daniel Eklöf
parent 01eca82d33
commit 9d5d84a835
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -12,7 +12,8 @@ is_debug_build = get_option('buildtype').startswith('debug')
cc = meson.get_compiler('c')
if cc.has_function('memfd_create')
if cc.has_function('memfd_create',
args: ['-D_GNU_SOURCE'], prefix: '#include <sys/mman.h>')
add_project_arguments('-DMEMFD_CREATE', language: 'c')
endif