blob: 2074c5cbf9e55ccad116dbe66ba02b84eb0b1d7b [file] [log] [blame]
Collin Baker8cc20b862023-02-17 21:55:251# Copyright 2023 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
Collin Baker81e65742023-03-21 18:02:425# Provides per-crate and overall configuration options to gnrt.
6
7[all]
8# force-unstable-if-unmarked prevents normal crates from inadvertently using
9# symbols from std-internal dependencies in the sysroot. This is normally passed
10# during an x.py build, but we have to do it manually.
11rustflags = ['-Zforce-unstable-if-unmarked']
12
Collin Baker59d3fdf52023-03-24 14:36:3013# Override the GN output dir. We direct std targets to output directly to the
14# sysroot we'll use later. This must stay in sync with `local_rustc_sysroot` in
15# //build/rust/std/BUILD.gn
16output_dir = '$root_out_dir/local_rustc_sysroot/lib/rustlib/$rust_abi_target/lib/'
17
18# This target provides setup needed for building std.
19extra_deps = ['//build/rust/std:std_build_deps']
20
Collin Baker81e65742023-03-21 18:02:4221[crate.libc]
Collin Baker8cc20b862023-02-17 21:55:2522# Requires:
23# * cfg(libc_align) for new enough rustc, which is normally provided by build.rs
24# but we don't run build scripts for std crates.
25# * cfg(libc_priv_mod_use) is required for the below to work properly.
26# * cfg(libc_core_cvoid) to use the same ffi c_void definition as libcore.
27#
28# See https://github.com/rust-lang/libc/blob/master/build.rs
29cfg = ['libc_align', 'libc_priv_mod_use', 'libc_core_cvoid']
30
Collin Baker81e65742023-03-21 18:02:4231[crate.std]
Collin Baker8cc20b862023-02-17 21:55:2532# Requires:
33# * cfg(backtrace_in_libstd) because it directly includes .rs files from the
34# backtrace code rather than including it as a dependency. backtrace's
35# implementation has special-purpose code to handle this.
36# * STD_ENV_ARCH is referenced in architecture-dependent code. Note this is the
37# target arch, and as such `$rust_target_arch` is passed literally to GN. This
38# variable is set at build time in build/config/rust.gni
39#
40# See https://github.com/rust-lang/rust/blob/master/library/std/build.rs
41cfg = ['backtrace_in_libstd']
42env = ['STD_ENV_ARCH=$rust_target_arch']
43
Collin Baker81e65742023-03-21 18:02:4244[crate.test]
Collin Baker8cc20b862023-02-17 21:55:2545# Requires:
46# * CFG_DISABLE_UNSTABLE_FEATURES=0 to match how it's built by x.py.
47env = ['CFG_DISABLE_UNSTABLE_FEATURES=0']