nouveau: require cbindgen >= 0.25

So we can use the --depfile option, and not have to worry about new
files. Since it's Rust, the expectation is that you're going to have up
to date dependencies anyway.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28754>
This commit is contained in:
Dylan Baker 2024-04-15 11:19:50 -07:00 committed by Marge Bot
parent 2543f5a594
commit 706691a715

View file

@ -12,7 +12,7 @@ if rc.version().version_compare('< 1.73.0')
error('nil_rs requires Rust 1.73.0')
endif
prog_cbindgen = find_program('cbindgen', required : false, native : true)
prog_cbindgen = find_program('cbindgen', required : false, native : true, version : '>= 0.25')
dep_paste = dependency('paste',
version : '>= 1.0.14',
@ -38,16 +38,6 @@ _libnil_format_table = static_library(
gnu_symbol_visibility: 'hidden',
)
# Thanks to cbindgen, this does need to include everything
_libnil_files = files(
'lib.rs', # lib.rs has to come first
'extent.rs',
'format.rs',
'image.rs',
'tic.rs',
'tiling.rs',
)
_libnil_deps = [
dep_paste,
idep_bitview_rs,
@ -113,12 +103,14 @@ _libnil = static_library(
_nil_h = custom_target(
'nil_h',
input : [files('cbindgen.toml'), _libnil_files],
input : [files('cbindgen.toml'), 'lib.rs'],
output : ['nil.h'],
command : [
prog_cbindgen, '-q', '--config', '@INPUT0@', '--lang', 'c',
'--output', '@OUTPUT0@', '--', '@INPUT1@'
'--output', '@OUTPUT0@', '--depfile', '@DEPFILE@',
'--', '@INPUT1@',
],
depfile : 'nil.h.d',
)
idep_nil = declare_dependency(