mesa/subprojects/packagefiles/rustix/meson.build
Gurchetan Singh 8a2f43c9bd util: rust: update to rustix 1.0.7
Latest tagged release.  Fedora uses it, and for it to
work on Android we'll need to latest release so a pure
libc backend can be used.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35768>
2025-06-26 17:11:41 +00:00

44 lines
1.1 KiB
Meson

# Copyright © 2025 Google
# SPDX-License-Identifier: MIT
project(
'rustix',
'rust',
version : '1.0.7',
license : 'Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT',
)
errno = subproject('errno').get_variable('lib')
libc = subproject('libc').get_variable('lib')
linux_raw_sys = subproject('linux-raw-sys').get_variable('lib')
bitflags = subproject('bitflags').get_variable('lib')
rustix_args = []
if host_machine.system() == 'linux' or host_machine.system() == 'android'
rustix_args += [
'--cfg', 'linux_raw',
'--cfg', 'linux_kernel',
'--cfg', 'feature="std"',
'--cfg', 'feature="alloc"',
'--cfg', 'feature="event"',
'--cfg', 'feature="fs"',
'--cfg', 'feature="mm"',
'--cfg', 'feature="net"',
'--cfg', 'feature="param"',
'--cfg', 'feature="pipe"',
]
endif
lib = static_library(
'rustix',
'src/lib.rs',
override_options : ['rust_std=2021', 'build.rust_std=2021'],
link_with : [errno, libc, linux_raw_sys, bitflags],
rust_abi : 'rust',
native : true,
rust_args: rustix_args,
)
dep_rustix = declare_dependency(
link_with : [lib, errno, libc, linux_raw_sys, bitflags]
)