2024-12-16 17:01:47 -08:00
|
|
|
# Copyright © 2025 Google
|
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
|
|
project(
|
|
|
|
|
'rustix',
|
|
|
|
|
'rust',
|
2025-06-20 13:59:19 -07:00
|
|
|
version : '1.0.7',
|
2024-12-16 17:01:47 -08:00
|
|
|
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')
|
|
|
|
|
bitflags = subproject('bitflags').get_variable('lib')
|
|
|
|
|
|
|
|
|
|
rustix_args = []
|
|
|
|
|
if host_machine.system() == 'linux' or host_machine.system() == 'android'
|
|
|
|
|
rustix_args += [
|
2025-06-20 14:39:53 -07:00
|
|
|
'--cfg', 'linux_like',
|
2024-12-16 17:01:47 -08:00
|
|
|
'--cfg', 'linux_kernel',
|
2025-06-20 14:39:53 -07:00
|
|
|
'--cfg', 'libc',
|
|
|
|
|
'--cfg', 'feature="use-libc"',
|
2024-12-16 17:01:47 -08:00
|
|
|
'--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'],
|
2025-06-20 14:39:53 -07:00
|
|
|
link_with : [errno, libc, bitflags],
|
2024-12-16 17:01:47 -08:00
|
|
|
rust_abi : 'rust',
|
|
|
|
|
native : true,
|
|
|
|
|
rust_args: rustix_args,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
dep_rustix = declare_dependency(
|
2025-06-20 14:39:53 -07:00
|
|
|
link_with : [lib, errno, libc, bitflags]
|
2024-12-16 17:01:47 -08:00
|
|
|
)
|