diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-07-07 19:28:23 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-07-09 16:50:33 -0400 |
commit | e269d972d2ab64418e2cdf1565c80b472fafd3b1 (patch) | |
tree | e2640862530739b6425ed10b92106ad43ad8b006 | |
parent | c4d61accf4d19515d55a1277dee47467d44a5bbf (diff) |
Move libc build def to //build_extra/rust
This is preperation for adding many more third_party crates.
-rw-r--r-- | BUILD.gn | 14 | ||||
-rw-r--r-- | build_extra/rust/BUILD.gn | 8 | ||||
-rw-r--r-- | build_extra/rust/rust.gni | 5 |
3 files changed, 16 insertions, 11 deletions
@@ -14,28 +14,20 @@ config("deno_config") { rust_executable("deno") { source_root = "src/main.rs" - extern = [ ":libc" ] + extern = [ "$rust_build:libc" ] deps = [ ":libdeno", ] } -rust_component("libc") { - source_root = "third_party/rust_crates/libc/src/lib.rs" - cfg = [ - "feature=\"default\"", - "feature=\"use_std\"", - ] -} - rust_component("handlers") { source_root = "src/handlers.rs" - extern = [ ":libc" ] + extern = [ "$rust_build:libc" ] } rust_test("handlers_test") { source_root = "src/handlers.rs" - extern = [ ":libc" ] + extern = [ "$rust_build:libc" ] } executable("deno_cc") { diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn index e5a4fec16..0889ad840 100644 --- a/build_extra/rust/BUILD.gn +++ b/build_extra/rust/BUILD.gn @@ -13,3 +13,11 @@ rust_component("stdlib") { libs = [ "userenv.lib" ] } } + +rust_component("libc") { + source_root = "//third_party/rust_crates/libc/src/lib.rs" + cfg = [ + "feature=\"default\"", + "feature=\"use_std\"", + ] +} diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni index faa97205b..4c6b4ddd6 100644 --- a/build_extra/rust/rust.gni +++ b/build_extra/rust/rust.gni @@ -1,5 +1,10 @@ stdlib_label = "//build_extra/rust:stdlib" +declare_args() { + # Absolute path of rust build files. + rust_build = "//build_extra/rust/" +} + template("run_rustc") { action(target_name) { assert(defined(invoker.source_root), "Must specify source_root") |