make sure we also define HAVE_STRUCT_DIRENT_D_TYPE outside of autotools

This commit is contained in:
Jörg Thalheim 2023-12-16 09:18:04 +01:00
parent 8daea338f3
commit 89927c434c
2 changed files with 16 additions and 1 deletions

View file

@ -0,0 +1 @@
#mesondefine HAVE_STRUCT_DIRENT_D_TYPE

View file

@ -6,6 +6,20 @@ src = [
'worker.cc'
]
cc = meson.get_compiler('cpp')
autotool_config = configuration_data()
# nix defines this with autotools
if cc.has_member('struct dirent', 'd_type', prefix: '#include <dirent.h>')
autotool_config.set('HAVE_STRUCT_DIRENT_D_TYPE', 1)
endif
configure_file(
input: 'autotools-config.h.in',
output: 'autotools-config.h',
configuration: autotool_config
)
executable('nix-eval-jobs', src,
dependencies : [
nix_main_dep,
@ -17,4 +31,4 @@ executable('nix-eval-jobs', src,
threads_dep
],
install: true,
cpp_args: ['-std=c++2a', '-fvisibility=hidden'])
cpp_args: ['-std=c++2a', '-fvisibility=hidden', '--include', 'autotools-config.h'])