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
parent fb74a2df27
commit e9d43b2d26
No known key found for this signature in database
GPG key ID: 142B7BDAD4E1CA19

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