1toolchain("rust") { 2 tool("rust_bin") { 3 depfile = "{{target_out_dir}}/{{crate_name}}.d" 4 outfile = "{{target_out_dir}}/{{crate_name}}" 5 command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link -Z dep-info-omit-d-target {{rustflags}} -o $outfile {{rustdeps}} {{externs}}" 6 description = "RUST $outfile" 7 outputs = [ outfile ] 8 } 9 10 tool("rust_staticlib") { 11 depfile = "{{target_out_dir}}/{{crate_name}}.d" 12 outfile = "{{target_out_dir}}/{{crate_name}}.a" 13 command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link -Z dep-info-omit-d-target {{rustflags}} -o $outfile {{rustdeps}} {{externs}}" 14 description = "RUST $outfile" 15 outputs = [ outfile ] 16 } 17 18 tool("rust_rlib") { 19 depfile = "{{target_out_dir}}/{{crate_name}}.d" 20 outfile = "{{target_out_dir}}/lib{{crate_name}}.rlib" 21 command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link -Z dep-info-omit-d-target {{rustflags}} -o $outfile {{rustdeps}} {{externs}}" 22 description = "RUST $outfile" 23 outputs = [ outfile ] 24 } 25 26 tool("rust_cdylib") { 27 depfile = "{{target_out_dir}}/{{crate_name}}.d" 28 outfile = "{{target_out_dir}}/lib{{crate_name}}.so" 29 command = "rustc --crate-name {{crate_name}} {{source}} --crate-type {{crate_type}} --emit=dep-info=$depfile,link -Z dep-info-omit-d-target {{rustflags}} -o $outfile {{rustdeps}} {{externs}}" 30 description = "RUST $outfile" 31 outputs = [ outfile ] 32 } 33 34 tool("stamp") { 35 command = "touch {{output}}" 36 description = "STAMP {{output}}" 37 } 38 39 tool("copy") { 40 command = "cp -af {{source}} {{output}}" 41 description = "COPY {{source}} {{output}}" 42 } 43} 44 45config("rust_defaults") { 46 rustflags = [ "-Cdebuginfo=2" ] 47} 48