wayland: unbreak build without memfd_create

New FreeBSD versions have memfd_create but other BSDs don't.

bar/wayland.c:774:15: error: implicit declaration of function 'memfd_create' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    pool_fd = memfd_create("yambar-wayland-shm-buffer-pool", MFD_CLOEXEC);
              ^
bar/wayland.c:774:62: error: use of undeclared identifier 'MFD_CLOEXEC'
    pool_fd = memfd_create("yambar-wayland-shm-buffer-pool", MFD_CLOEXEC);
                                                             ^
This commit is contained in:
Jan Beich 2020-12-27 23:38:36 +00:00
parent f8e544ae05
commit ec465ba3b3
2 changed files with 14 additions and 3 deletions

View file

@ -12,6 +12,10 @@ plugs_as_libs = get_option('core-plugins-as-shared-libraries')
cc = meson.get_compiler('c')
if cc.has_function('memfd_create')
add_project_arguments('-DMEMFD_CREATE', language: 'c')
endif
# Compute the relative path used by compiler invocations.
source_root = meson.current_source_dir().split('/')
build_root = meson.build_root().split('/')