You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,31 @@ fn main() {
11
11
}
12
12
```
13
13
14
+
# External configuration via environment variables
15
+
16
+
To control the programs and flags used for building, the builder can set a number of different enviroment variables.
17
+
*`CFLAGS` - a series of space seperated flags passed to "gcc". Note that
18
+
individual flags cannot currently contain spaces, so doing
19
+
something like: "-L=foo\ bar" is not possible.
20
+
*`CC` - the actual c compiler used. Note that this is used as an exact
21
+
executable name, so (for example) no extra flags can be passed inside
22
+
this variable, and the builder must ensure that there aren't any
23
+
trailing spaces. This compiler must understand the `-c` flag. For
24
+
certain `TARGET`s, it also is assumed to know about other flags (most
25
+
common is `-fPIC`).
26
+
*`AR` - the `ar` (archiver) executable to use to build the static library.
27
+
28
+
Each of these variables can also be supplied with certain prefixes and suffixes, in the following prioritized order:
29
+
30
+
1.`<var>_<target>` - for example, `CC_x86_64-unknown-linux-gnu`
31
+
1.`<var>_<target_with_underscores>` - for example, `CC_x86_64_unknown_linux_gnu`
32
+
1.`<build-kind>_<var>` - for example, `HOST_CC` or `TARGET_CFLAGS`
33
+
1.`<var>` - a plain `CC`, `AR` as above.
34
+
35
+
If none of these varaibles exist, gcc-rs uses built-in defaults
36
+
37
+
In addition to the the above optional environment variables, `gcc-rs` has some functions with hard requirements on some variables supplied by [cargo's build-script driver][cargo] that it has the `TARGET`, `OUT_DIR`, `OPT_LEVEL`, and `HOST` variables
38
+
14
39
# Windows notes
15
40
16
41
Currently use of this crate means that Windows users will require gcc to be
0 commit comments