summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/build/rust/tests/test_rust_source_set/BUILD.gn
blob: 0dc9c540e13f513fee6bcd9d866cac5c4560f3e3 (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
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/compiler/compiler.gni")
import("//build/config/rust.gni")

# A future CL will provide a gn template to generate all the following
# automatically. We anticipate calling that template "rust_source_set"
# which is why this test component is named the way it is.

# Dependent Rust targets should depend on this.
rust_library("test_rust_source_set") {
  crate_name = "test_rust_source_set"
  crate_root = "main.rs"
  rustflags = [
    "--edition",
    "2018",
  ]
}

# Dependent C++ targets should depend on this,
# rather than the rlib above
group("test_rust_source_set_lib") {
  deps = [
    ":test_rust_source_set",
    "//build/rust/std",
  ]
}

if (build_rust_unit_tests) {
  executable("test_rust_source_set_unittests") {
    crate_root = "main.rs"
    rustflags = [
      "--cfg",
      "feature=\"test\"",
      "--test",
      "--edition",
      "2018",
    ]
  }
}