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 "main.cc", 63 "packet_def.cc", 64 "packet_dependency.cc", 65 "parent_def.cc", 66 "struct_def.cc", 67 "struct_parser_generator.cc", 68 ] 69 70 include_dirs = [ "//bt/system/gd/packet/parser" ] 71 72 deps = [ 73 ":pktlexer", 74 ":pktparser", 75 ] 76 configs += [ ":pktgen_configs" ] 77} 78 79flex_source("pktlexer") { 80 sources = [ "language_l.ll" ] 81 82 deps = [ 83 ":pktparser", 84 ] 85 configs = [ ":pktgen_configs" ] 86} 87 88bison_source("pktparser") { 89 sources = [ "language_y.yy" ] 90 configs = [ ":pktgen_configs" ] 91} 92