blob: 3b6b8dc7ecae04d0fa3cd717bc21ab8766e47ddf [file] [log] [blame]
toolchain("rust") {
tool("rust_bin") {
depfile = "{{target_out_dir}}/{{crate_name}}.d"
outfile = "{{target_out_dir}}/{{crate_name}}"
command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link {{rustflags}} -o $outfile {{rustdeps}} {{externs}}"
description = "RUST $outfile"
outputs = [ outfile ]
}
tool("rust_staticlib") {
depfile = "{{target_out_dir}}/{{crate_name}}.d"
outfile = "{{target_out_dir}}/{{crate_name}}.a"
command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link {{rustflags}} -o $outfile {{rustdeps}} {{externs}}"
description = "RUST $outfile"
outputs = [ outfile ]
}
tool("rust_rlib") {
depfile = "{{target_out_dir}}/{{crate_name}}.d"
outfile = "{{target_out_dir}}/lib{{crate_name}}.rlib"
command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link {{rustflags}} -o $outfile {{rustdeps}} {{externs}}"
description = "RUST $outfile"
outputs = [ outfile ]
}
tool("rust_cdylib") {
depfile = "{{target_out_dir}}/{{crate_name}}.d"
outfile = "{{target_out_dir}}/lib{{crate_name}}.so"
command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link {{rustflags}} -o $outfile {{rustdeps}} {{externs}}"
description = "RUST $outfile"
outputs = [ outfile ]
}
tool("stamp") {
command = "touch {{output}}"
description = "STAMP {{output}}"
}
tool("copy") {
command = "cp -af {{source}} {{output}}"
description = "COPY {{source}} {{output}}"
}
}
config("rust_defaults") {
rustflags = [ "-Cdebuginfo=2" ]
}