summaryrefslogtreecommitdiff
path: root/core/BUILD.gn
blob: 821d5a46b24f95c2b3d333f2a6de52563d5353e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import("//build_extra/rust/rust.gni")

group("default") {
  testonly = true
  deps = [
    ":deno",
    ":deno_core_http_bench",
    ":deno_core_http_bench_test",
    ":deno_core_test",
  ]
}

group("deno_core_deps") {
  deps = [
    "libdeno:libdeno_static_lib",
    "libdeno:v8",
  ]
}

# deno does not depend on flatbuffers nor tokio.
main_extern = [
  "$rust_build:futures",
  "$rust_build:libc",
  "$rust_build:serde_json",
  "$rust_build:log",
]

rust_crate("deno") {
  source_root = "lib.rs"
  deps = [
    ":deno_core_deps",
  ]
  extern = main_extern
}

rust_test("deno_core_test") {
  source_root = "lib.rs"
  deps = [
    ":deno_core_deps",
  ]
  extern = main_extern
}

http_bench_extern = [
  "$rust_build:futures",
  "$rust_build:lazy_static",
  "$rust_build:libc",
  "$rust_build:log",
  "$rust_build:tokio",
  ":deno",
]
if (is_win) {
  http_bench_extern += [ "$rust_build:winapi" ]
}

rust_executable("deno_core_http_bench") {
  source_root = "examples/http_bench.rs"
  deps = [
    ":deno_core_deps",
  ]
  extern = http_bench_extern
}

rust_test("deno_core_http_bench_test") {
  source_root = "examples/http_bench.rs"
  deps = [
    ":deno_core_deps",
  ]
  extern = http_bench_extern
}