Skip to content

Commit a83dd4d

Browse files
jimmunnigaw
authored andcommitted
build: Fix build failure in generate-accessors with -Werror set.
The generate-accessors native executable uses asprintf() which requires _GNU_SOURCE. While the main project defines this flag via add_project_arguments(), native executables don't inherit these settings and need it explicitly defined. This fix adds -D_GNU_SOURCE to the c_args for the generate_accessors executable, resolving the implicit declaration warning that becomes a build error when -Werror is enabled.
1 parent 9f3f0f5 commit a83dd4d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

libnvme/src/nvme/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ headers_to_scan = [
2020
generate_accessors = executable(
2121
'generate-accessors',
2222
'generate-accessors.c',
23+
c_args: ['-D_GNU_SOURCE'],
2324
dependencies: [
2425
config_dep,
2526
],

0 commit comments

Comments
 (0)