aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShogo Yamazaki <pgp@mocknen.net>2024-08-07 05:12:13 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-08-09 06:14:12 +0000
commit9d5d84a8350ec73f432d0522c274764ee37a9a50 (patch)
tree1626192e2f0402ef3143f469eff3d7a65f732837
parentreadme: remove CI badges for gitlab and sr.ht (diff)
meson: fix false positive detection of `memfd_create`
Add the arguments to `has_function` to properly detect availability of the function on SDK environments.
-rw-r--r--meson.build3
1 files changed, 2 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index a99d1a48..7ce9d901 100644
--- a/meson.build
+++ b/meson.build
@@ -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