summaryrefslogtreecommitdiff
path: root/system/gd/packet/parser/BUILD.gn
blob: c9ac6c35d97b213933957eced1720d4154fd82b7 (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#
#  Copyright 2021 Google, Inc.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at:
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.
#

import("flex.gni")
import("bison.gni")

config("pktgen_configs") {
  include_dirs = [ "//bt/system/gd/packet/parser" ]

  cflags = [ "-fPIC" ]

  cflags_cc = [
    "-std=c++17",
    "-Wno-inconsistent-missing-override",
    "-Wno-implicit-fallthrough",
    "-Wno-poison-system-directories",
    "-Wno-unknown-warning-option",
  ]
}

executable("bluetooth_packetgen") {
  sources = [
    "checksum_def.cc",
    "custom_field_def.cc",
    "enum_def.cc",
    "enum_gen.cc",
    "fields/array_field.cc",
    "fields/body_field.cc",
    "fields/checksum_field.cc",
    "fields/checksum_start_field.cc",
    "fields/count_field.cc",
    "fields/custom_field.cc",
    "fields/custom_field_fixed_size.cc",
    "fields/enum_field.cc",
    "fields/fixed_enum_field.cc",
    "fields/fixed_field.cc",
    "fields/fixed_scalar_field.cc",
    "fields/group_field.cc",
    "fields/packet_field.cc",
    "fields/padding_field.cc",
    "fields/payload_field.cc",
    "fields/reserved_field.cc",
    "fields/scalar_field.cc",
    "fields/size_field.cc",
    "fields/struct_field.cc",
    "fields/variable_length_struct_field.cc",
    "fields/vector_field.cc",
    "gen_cpp.cc",
    "gen_rust.cc",
    "main.cc",
    "packet_def.cc",
    "packet_dependency.cc",
    "parent_def.cc",
    "struct_def.cc",
    "struct_parser_generator.cc",
  ]

  include_dirs = [ "//bt/system/gd/packet/parser" ]

  deps = [
    ":pktlexer",
    ":pktparser",
  ]
  configs += [ ":pktgen_configs" ]
}

flex_source("pktlexer") {
  sources = [ "language_l.ll" ]

  deps = [
    ":pktparser",
  ]
  configs = [ ":pktgen_configs" ]
}

bison_source("pktparser") {
  sources = [ "language_y.yy" ]
  configs = [ ":pktgen_configs" ]
}