subprojects: add libc

Version 0.2.168 supported in:

     - Android
     - Fedora
       (https://bodhi.fedoraproject.org/updates/?packages=rust-libc)
     - Debian (https://tracker.debian.org/pkg/rust-libc)

Acked-by: Aaron Ruby <aruby@qnx.com>
Reviewed-by: @LingMan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35210>
This commit is contained in:
Gurchetan Singh 2024-12-17 07:30:26 -08:00 committed by Marge Bot
parent 734dd83494
commit 59e2d1e549
2 changed files with 50 additions and 0 deletions

6
subprojects/libc.wrap Normal file
View file

@ -0,0 +1,6 @@
[wrap-file]
directory = libc-0.2.168
source_url = https://crates.io/api/v1/crates/libc/0.2.168/download
source_filename = libc-0.2.168.tar.gz
source_hash = 5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d
patch_directory = libc

View file

@ -0,0 +1,44 @@
# Copyright © 2024 Google
# SPDX-License-Identifier: MIT
project(
'libc',
'rust',
version : '0.2.168',
license : 'MIT OR Apache-2.0',
)
libc_args = [
'--cfg', 'feature="default"',
'--cfg', 'feature="extra_traits"',
'--cfg', 'feature="std"',
'--cfg', 'freebsd11',
'--cfg', 'freebsd11',
'--cfg', 'freebsd11',
'--cfg', 'libc_align',
'--cfg', 'libc_cfg_target_vendor',
'--cfg', 'libc_const_extern_fn',
'--cfg', 'libc_const_size_of',
'--cfg', 'libc_core_cvoid',
'--cfg', 'libc_int128',
'--cfg', 'libc_long_array',
'--cfg', 'libc_non_exhaustive',
'--cfg', 'libc_packedN',
'--cfg', 'libc_priv_mod_use',
'--cfg', 'libc_ptr_addr_of',
'--cfg', 'libc_underscore_const_names',
'--cfg', 'libc_union',
]
lib = static_library(
'libc',
'src/lib.rs',
rust_abi : 'rust',
override_options : ['rust_std=2021', 'build.rust_std=2021'],
native : true,
rust_args: libc_args,
)
dep_libc = declare_dependency(
link_with : [lib]
)