|
| 1 | +# Copyright © 2026 Google |
| 2 | +# SPDX-License-Identifier: MIT |
| 3 | + |
| 4 | +project( |
| 5 | + 'rustix', |
| 6 | + 'rust', |
| 7 | + version : '1.1.3', |
| 8 | + license : 'Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT', |
| 9 | +) |
| 10 | + |
| 11 | +dep_errno = dependency('errno-0.3-rs', fallback: ['errno-0.3-rs', 'dep_errno']) |
| 12 | +dep_libc = dependency('libc-0.2-rs', fallback: ['libc-0.2-rs', 'dep_libc']) |
| 13 | +dep_bitflags = dependency('bitflags-2-rs', fallback: ['bitflags-2-rs', 'dep_bitflags']) |
| 14 | + |
| 15 | +rustix_args = [ |
| 16 | + '--cfg', 'libc', |
| 17 | + '--cfg', 'feature="use-libc"', |
| 18 | +] |
| 19 | + |
| 20 | +os_deps = [] |
| 21 | +if host_machine.system() == 'linux' or host_machine.system() == 'android' |
| 22 | + rustix_args += [ |
| 23 | + '--cfg', 'linux_like', |
| 24 | + '--cfg', 'linux_kernel', |
| 25 | + '--cfg', 'feature="std"', |
| 26 | + '--cfg', 'feature="alloc"', |
| 27 | + '--cfg', 'feature="event"', |
| 28 | + '--cfg', 'feature="fs"', |
| 29 | + '--cfg', 'feature="mm"', |
| 30 | + '--cfg', 'feature="net"', |
| 31 | + '--cfg', 'feature="param"', |
| 32 | + '--cfg', 'feature="pipe"', |
| 33 | + '--cfg', 'feature="thread"', |
| 34 | +] |
| 35 | +elif host_machine.system() == 'windows' |
| 36 | + os_deps += [dependency('windows-sys-0.6-rs', fallback: ['windows-sys-0.6-rs', 'dep_windows_sys'])] |
| 37 | +endif |
| 38 | + |
| 39 | +lib = static_library( |
| 40 | + 'rustix', |
| 41 | + 'src/lib.rs', |
| 42 | + override_options : ['rust_std=2021', 'build.rust_std=2021'], |
| 43 | + dependencies : [dep_errno, dep_libc, dep_bitflags] + os_deps, |
| 44 | + rust_abi : 'rust', |
| 45 | + rust_args: rustix_args, |
| 46 | +) |
0 commit comments