build/config/rust/BUILD.gn
config("edition_2024") {
rustflags = [ "--edition=2024" ]
}
config("edition_2021") {
rustflags = [ "--edition=2021" ]
}
config("lints") {
rustflags = [
"-Dwarnings",
"-Dunsafe_op_in_unsafe_fn",
]
}
config("debug") {
rustflags = [
"-Cdebuginfo=2",
"-Copt-level=0",
]
}
config("release") {
rustflags = [
"-Copt-level=3",
"-Clto=thin",
"-Ccodegen-units=1",
]
}
config("defaults") {
configs = [
":lints",
]
if (build_mode == "debug") {
configs += [ ":debug" ]
} else {
configs += [ ":release" ]
}
}