• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2#  Copyright 2021 Google, Inc.
3#
4#  Licensed under the Apache License, Version 2.0 (the "License");
5#  you may not use this file except in compliance with the License.
6#  You may obtain a copy of the License at:
7#
8#  http://www.apache.org/licenses/LICENSE-2.0
9#
10#  Unless required by applicable law or agreed to in writing, software
11#  distributed under the License is distributed on an "AS IS" BASIS,
12#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13#  See the License for the specific language governing permissions and
14#  limitations under the License.
15#
16
17import("flex.gni")
18import("bison.gni")
19
20config("pktgen_configs") {
21  include_dirs = [ "//bt/system/gd/packet/parser" ]
22
23  cflags = [ "-fPIC" ]
24
25  cflags_cc = [
26    "-std=c++17",
27    "-Wno-inconsistent-missing-override",
28    "-Wno-implicit-fallthrough",
29    "-Wno-poison-system-directories",
30    "-Wno-unknown-warning-option",
31  ]
32}
33
34executable("bluetooth_packetgen") {
35  sources = [
36    "checksum_def.cc",
37    "custom_field_def.cc",
38    "enum_def.cc",
39    "enum_gen.cc",
40    "fields/array_field.cc",
41    "fields/body_field.cc",
42    "fields/checksum_field.cc",
43    "fields/checksum_start_field.cc",
44    "fields/count_field.cc",
45    "fields/custom_field.cc",
46    "fields/custom_field_fixed_size.cc",
47    "fields/enum_field.cc",
48    "fields/fixed_enum_field.cc",
49    "fields/fixed_field.cc",
50    "fields/fixed_scalar_field.cc",
51    "fields/group_field.cc",
52    "fields/packet_field.cc",
53    "fields/padding_field.cc",
54    "fields/payload_field.cc",
55    "fields/reserved_field.cc",
56    "fields/scalar_field.cc",
57    "fields/size_field.cc",
58    "fields/struct_field.cc",
59    "fields/variable_length_struct_field.cc",
60    "fields/vector_field.cc",
61    "gen_cpp.cc",
62    "gen_rust.cc",
63    "main.cc",
64    "packet_def.cc",
65    "packet_dependency.cc",
66    "parent_def.cc",
67    "struct_def.cc",
68    "struct_parser_generator.cc",
69  ]
70
71  include_dirs = [ "//bt/system/gd/packet/parser" ]
72
73  deps = [
74    ":pktlexer",
75    ":pktparser",
76  ]
77  configs += [ ":pktgen_configs" ]
78}
79
80flex_source("pktlexer") {
81  sources = [ "language_l.ll" ]
82
83  deps = [
84    ":pktparser",
85  ]
86  configs = [ ":pktgen_configs" ]
87}
88
89bison_source("pktparser") {
90  sources = [ "language_y.yy" ]
91  configs = [ ":pktgen_configs" ]
92}
93