summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/rust.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-10-16 16:02:28 -0700
committerDylan Baker <dylan@pnwbakers.com>2024-02-23 09:48:32 -0800
commite7f20efc8bd123bfc2c325198866850694612a23 (patch)
treef4c08b4bf94d9a429322f25a3ab9b1e1f39c539e /mesonbuild/modules/rust.py
parent9752b89100a9ffc42a6eb4a788f806958bda1107 (diff)
downloadmeson-e7f20efc8bd123bfc2c325198866850694612a23.tar.gz
modules/rust: allow setting a version constraint on bindgen
This allows us to ensure that the bindgen we're using is suitable for our purpose.
Diffstat (limited to 'mesonbuild/modules/rust.py')
-rw-r--r--mesonbuild/modules/rust.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py
index 6a00fb3ce..fb8528088 100644
--- a/mesonbuild/modules/rust.py
+++ b/mesonbuild/modules/rust.py
@@ -48,6 +48,7 @@ if T.TYPE_CHECKING:
output: str
dependencies: T.List[T.Union[Dependency, ExternalLibrary]]
language: T.Optional[Literal['c', 'cpp']]
+ bindgen_version: T.List[str]
class RustModule(ExtensionModule):
@@ -192,6 +193,7 @@ class RustModule(ExtensionModule):
required=True,
),
KwargInfo('language', (str, NoneType), since='1.4.0', validator=in_set_validator({'c', 'cpp'})),
+ KwargInfo('bindgen_version', ContainerTypeInfo(list, str), default=[], listify=True, since='1.4.0'),
INCLUDE_DIRECTORIES.evolve(since_values={ContainerTypeInfo(list, str): '1.0.0'}),
OUTPUT_KW,
DEPENDENCIES_KW.evolve(since='1.0.0'),
@@ -236,7 +238,7 @@ class RustModule(ExtensionModule):
depends.append(s)
if self._bindgen_bin is None:
- self._bindgen_bin = state.find_program('bindgen')
+ self._bindgen_bin = state.find_program('bindgen', wanted=kwargs['bindgen_version'])
name: str
if isinstance(header, File):