1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//! A crate that provides programmatic access to information about the current build target inside `build.rs`.
//!
//! ## Examples
//! Prints all available information about the current build target.
//! ```rust no_run
//! // inside build.rs
//!
//! fn main() {
//! // The panic is just used to print the information to the console.
//! panic!("current build target: {:#?}",
//! build_target::target()
//! );
//! }
//! ```
//!
//! Gets the parts of the current build target individually.
//! ```rust no_run
//! // inside build.rs
//!
//! fn main() {
//! let arch = build_target::target_arch(); // eg. "x86_64", "aarch64", ...
//! let endian = build_target::target_endian(); // eg. "big", "little", ...
//! let env = build_target::target_env(); // eg. "gnu", "msvc", ...
//! let family = build_target::target_family(); // eg. "windows", "unix", ...
//! let pw = build_target::target_pointer_width(); // eg. "32", "64", ...
//! let os = build_target::target_os(); // eg. "android", "linux", ...
//! let vendor = build_target::target_vendor(); // eg. "apple", "unknown", ...
//! let triple = build_target::target_triple(); // eg. "x86_64-unknown-linux-gnu", ...
//! }
//! ```
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
use cratebuild_env;
/// Gets the current target [`Arch`]. This function is equivalent to [`Arch::target()`].
/// Gets the current target [`Endian`]. This function is equivalent to [`Endian::target()`].
/// Gets the current target [`Env`]. This function is equivalent to [`Env::target()`].
/// Gets the current target [`Family`]s. This function is equivalent to [`Family::target()`].
/// Gets the current target [`Os`]. This function is equivalent to [`Os::target()`].
/// Gets the current target [`PointerWidth`]. This function is equivalent to [`PointerWidth::target()`].
/// Gets the current target [`Vendor`]. This function is equivalent to [`Vendor::target()`].
/// Gets the current target triple.
/// Gets the current target information as a [`Target`]. This function is equivalent to [`Target::current()`].