1
1
# Build Scripts
2
2
3
- Sometimes a normal build from cargo is not enough. Perhaps your crate needs some
4
- pre-requisites before cargo will successfully compile, things like code
3
+ Sometimes a normal build from ` cargo ` is not enough. Perhaps your crate needs
4
+ some pre-requisites before ` cargo ` will successfully compile, things like code
5
5
generation, or some native code that needs to be compiled. To solve this problem
6
6
we have build scripts that Cargo can run.
7
7
@@ -20,7 +20,7 @@ default.
20
20
## How to use a build script
21
21
22
22
The build script is simply another Rust file that will be compiled and invoked
23
- prior to compiling anything else in the package. Hence it can be used to fulfil
23
+ prior to compiling anything else in the package. Hence it can be used to fulfill
24
24
pre-requisites of your crate.
25
25
26
26
Cargo provides the script with inputs via environment variables [ specified
@@ -29,10 +29,11 @@ here] that can be used.
29
29
The script provides output via stdout. All lines printed are written to
30
30
` target/debug/build/<pkg>/output ` . Further, lines prefixed with ` cargo: ` will be
31
31
interpreted by Cargo directly and hence can be used to define parameters for the
32
- packages compilation.
32
+ package's compilation.
33
33
34
- For further specification and examples have a read of the [ cargo specification] .
34
+ For further specification and examples have a read of the
35
+ [ Cargo specification] [ cargo_specification ] .
35
36
36
37
[ specified here ] : https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
37
38
38
- [ cargo specification ] : https://doc.rust-lang.org/cargo/reference/build-scripts.html
39
+ [ cargo_specification ] : https://doc.rust-lang.org/cargo/reference/build-scripts.html
0 commit comments