Commit 2fa692d
committed
Use Cargo's target information when possible
rustc's target triples generally only have a vague resemblance to each
other and to the information needed by `cc`. Let's instead prefer
`CARGO_CFG_*` variables when available, since these contain the
information directly from the compiler itself.
In the cases where it isn't available (i.e. when running outside of a
build script), we fall back to parsing the target triple, but instead of
doing it in an ad-hoc fashion with string manipulation, we do it in a
more structured fashion up front.1 parent 268fb9b commit 2fa692d
File tree
5 files changed
+713
-429
lines changed- dev-tools/gen-target-info/src
- src
- windows
5 files changed
+713
-429
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
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 | 8 | | |
37 | | - | |
38 | | - | |
39 | 9 | | |
40 | 10 | | |
41 | 11 | | |
| |||
45 | 15 | | |
46 | 16 | | |
47 | 17 | | |
48 | | - | |
49 | | - | |
| 18 | + | |
50 | 19 | | |
51 | 20 | | |
52 | 21 | | |
| |||
0 commit comments