From 89927c434c31187603f7f4f328d8a1a3a7dba033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 16 Dec 2023 09:18:04 +0100 Subject: [PATCH] make sure we also define HAVE_STRUCT_DIRENT_D_TYPE outside of autotools --- src/autotools-config.h.in | 1 + src/meson.build | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/autotools-config.h.in diff --git a/src/autotools-config.h.in b/src/autotools-config.h.in new file mode 100644 index 0000000..4cee198 --- /dev/null +++ b/src/autotools-config.h.in @@ -0,0 +1 @@ +#mesondefine HAVE_STRUCT_DIRENT_D_TYPE diff --git a/src/meson.build b/src/meson.build index cf47097..dfbcd87 100644 --- a/src/meson.build +++ b/src/meson.build @@ -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 ') + 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'])