diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-07-10 14:56:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 14:56:12 -0400 |
commit | d160de7f445e5d79883f2e8d97584b8afd009cc7 (patch) | |
tree | c446aa21cafba061088b330c29aae0863c5e6049 /build_extra/rust/rust.gni | |
parent | e269d972d2ab64418e2cdf1565c80b472fafd3b1 (diff) |
Add rust url crate. (#355)
Diffstat (limited to 'build_extra/rust/rust.gni')
-rw-r--r-- | build_extra/rust/rust.gni | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni index 4c6b4ddd6..095904d4b 100644 --- a/build_extra/rust/rust.gni +++ b/build_extra/rust/rust.gni @@ -107,6 +107,12 @@ template("run_rustc") { "--extern", "$name=" + rebase_path(rlib, root_build_dir), ] + + # This is needed for transitive dependencies. + args += [ + "-L", + "dependency=" + rebase_path(dir, root_build_dir), + ] } } } @@ -152,6 +158,26 @@ template("rust_component") { } } +template("rust_staticlib") { + rust_component(target_name) { + crate_type = "staticlib" + forward_variables_from(invoker, + [ + "crate_name", + "extern", + "cfg", + "source_root", + "testonly", + ]) + if (current_os == "mac") { + libs = [ "resolv" ] + } + if (current_os == "win") { + libs = [ "userenv.lib" ] + } + } +} + template("rust_executable") { bin_name = target_name + "_bin" bin_label = ":" + bin_name |