BUILD.gn 2.16 KB
Newer Older
1 2 3 4
# Copyright 2019 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

5
import("../../gni/v8.gni")
6

7
config("crdtp_config") {
8
  visibility = [ "../../src/inspector:*", ":*" ]
9 10 11 12
  configs = [ "../../:internal_config" ]
  include_dirs = [ "../../include" ]
}

13
v8_source_set("crdtp") {
14
  sources = [
15 16
    "crdtp/cbor.cc",
    "crdtp/cbor.h",
17 18
    "crdtp/dispatch.cc",
    "crdtp/dispatch.h",
19 20
    "crdtp/error_support.cc",
    "crdtp/error_support.h",
21
    "crdtp/export.h",
22
    "crdtp/find_by_first.h",
23 24
    "crdtp/json.cc",
    "crdtp/json.h",
25
    "crdtp/maybe.h",
26
    "crdtp/parser_handler.h",
27 28
    "crdtp/protocol_core.cc",
    "crdtp/protocol_core.h",
29 30
    "crdtp/serializable.cc",
    "crdtp/serializable.h",
31
    "crdtp/serializer_traits.h",
32
    "crdtp/span.cc",
33 34 35 36
    "crdtp/span.h",
    "crdtp/status.cc",
    "crdtp/status.h",
  ]
37
  configs = [ ":crdtp_config" ]
38
  deps = [ ":crdtp_platform" ]
39 40
}

41 42 43 44 45 46 47
# A small adapter library which only :crdtp may depend on.
v8_source_set("crdtp_platform") {
  visibility = [ ":crdtp" ]
  sources = [
    "crdtp/json_platform.h",
    "crdtp/json_platform_v8.cc",
  ]
48
  public_deps = [ "../..:v8_libbase" ]
49 50 51 52
  configs = [ ":crdtp_config" ]
}

# These tests are linked into test/unittests.
53
v8_source_set("crdtp_test") {
54
  sources = [
55
    "crdtp/cbor_test.cc",
56
    "crdtp/dispatch_test.cc",
57
    "crdtp/error_support_test.cc",
58
    "crdtp/find_by_first_test.cc",
59 60
    "crdtp/glue_test.cc",
    "crdtp/json_test.cc",
61
    "crdtp/serializable_test.cc",
62
    "crdtp/serializer_traits_test.cc",
63 64
    "crdtp/span_test.cc",
    "crdtp/status_test.cc",
65 66
    "crdtp/status_test_support.cc",
    "crdtp/status_test_support.h",
67
  ]
68
  configs = [ ":crdtp_config" ]
69
  deps = [ ":crdtp_test_platform" ]
70 71 72 73 74 75 76 77 78 79 80
  testonly = true
}

# A small adapter library which only :crdtp_test may depend on.
v8_source_set("crdtp_test_platform") {
  sources = [
    "crdtp/test_platform.h",
    "crdtp/test_platform_v8.cc",
  ]
  configs = [ ":crdtp_config" ]
  public_deps = [
81
    ":crdtp",
82 83 84 85 86
    "../..:v8_libbase",
    "../../src/inspector:inspector_string_conversions",
    "//testing/gmock",
    "//testing/gtest",
  ]
87
  testonly = true
88
}