| 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}}" | |
| } | |
| tool("cxx") { | |
| depfile = "{{output}}.d" | |
| command = "clang++ -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" | |
| depsformat = "gcc" | |
| description = "CXX {{output}}" | |
| outputs = [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] | |
| } | |
| tool("alink") { | |
| command = "llvm-ar rcs {{output}} {{inputs}}" | |
| description = "AR {{target_output_name}}{{output_extension}}" | |
| outputs = [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ] | |
| default_output_extension = ".a" | |
| output_prefix = "lib" | |
| } | |
| tool("link") { | |
| outfile = "{{target_output_name}}{{output_extension}}" | |
| rspfile = "$outfile.rsp" | |
| command = "clang++ {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} {{libs}} {{rlibs}} -Wl,--end-group" | |
| description = "LINK $outfile" | |
| default_output_dir = "{{root_out_dir}}" | |
| rspfile_content = "{{inputs}}" | |
| outputs = [ outfile ] | |
| } | |
| } | |
| config("rust_defaults") { | |
| rustflags = [ "-Cdebuginfo=2" ] | |
| } |