2018-07-06 00:58:09 -04:00
|
|
|
import("rust.gni")
|
|
|
|
|
2018-07-10 14:56:12 -04:00
|
|
|
# Dependencies between third party crates is mapped out here manually. This is
|
|
|
|
# not so difficult and having it be tedious to add dependencies might help us
|
|
|
|
# avoid dependency hell later on.
|
|
|
|
# Versioning for third party rust crates is controlled in //gclient_config.py
|
|
|
|
# TODO(ry) Use Cargo for versioning?
|
|
|
|
|
2018-07-06 00:58:09 -04:00
|
|
|
# By compiling an empty file as crate-type=staticlib we get all the code
|
|
|
|
# for the rust stdlib, which are not included in the object file outputs
|
|
|
|
# of other libs.
|
2018-07-10 14:56:12 -04:00
|
|
|
# TODO(ry) This is not used and maybe should be removed along with empty.rs.
|
|
|
|
rust_staticlib("stdlib") {
|
2018-07-06 00:58:09 -04:00
|
|
|
source_root = "empty.rs"
|
|
|
|
}
|
2018-07-07 19:28:23 -04:00
|
|
|
|
2018-07-10 14:56:12 -04:00
|
|
|
crates = "//third_party/rust_crates"
|
|
|
|
|
2018-07-07 19:28:23 -04:00
|
|
|
rust_component("libc") {
|
2018-07-10 14:56:12 -04:00
|
|
|
source_root = "$crates/libc/src/lib.rs"
|
|
|
|
cfg = [ "feature=\"use_std\"" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_component("url") {
|
|
|
|
source_root = "$crates/url/src/lib.rs"
|
|
|
|
extern = [
|
|
|
|
":matches",
|
|
|
|
":idna",
|
|
|
|
":percent_encoding",
|
2018-07-07 19:28:23 -04:00
|
|
|
]
|
|
|
|
}
|
2018-07-10 14:56:12 -04:00
|
|
|
|
|
|
|
rust_component("percent_encoding") {
|
|
|
|
source_root = "$crates/url/percent_encoding/lib.rs"
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_component("matches") {
|
|
|
|
source_root = "$crates/rust-std-candidates/matches/lib.rs"
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_component("idna") {
|
|
|
|
source_root = "$crates/url/idna/src/lib.rs"
|
|
|
|
extern = [
|
|
|
|
":matches",
|
|
|
|
":unicode_bidi",
|
|
|
|
":unicode_normalization",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_component("unicode_bidi") {
|
|
|
|
source_root = "$crates/unicode-bidi/src/lib.rs"
|
|
|
|
extern = [ ":matches" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_component("unicode_normalization") {
|
|
|
|
source_root = "$crates/unicode-normalization/src/lib.rs"
|
|
|
|
}
|
2018-07-16 21:27:37 -04:00
|
|
|
|
|
|
|
rust_component("log") {
|
|
|
|
source_root = "$crates/log/src/lib.rs"
|
|
|
|
extern = [ ":cfg_if" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
rust_component("cfg_if") {
|
|
|
|
source_root = "$crates/cfg_if/src/lib.rs"
|
|
|
|
}
|