blob: b6b46caae9faf23e10b65285275547f47e902f76 [file] [log] [blame]
# Copyright 2021 The Fuchsia 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/cpp/library_headers.gni")
shared_library("libpcap") {
output_name = "pcap"
sources = [
"src/bpf_dump.c",
"src/bpf_filter.c",
"src/bpf_image.c",
"src/etherent.c",
"src/fad-getad.c",
"src/fmtutils.c",
"src/gencode.c",
"src/grammar.c",
"src/nametoaddr.c",
"src/optimize.c",
"src/pcap-common.c",
"src/pcap.c",
"src/savefile.c",
"src/scanner.c",
"src/sf-pcap.c",
"src/sf-pcapng.c",
# To build for the null-platform, use `src/pcap-null.c` instead of
# `pcap-fuchsia.{c,cc}`.
"pcap-fuchsia.c",
"pcap-fuchsia.cc",
]
defines = [
"HAVE_CONFIG_H",
"BUILDING_PCAP",
"pcap_EXPORTS",
]
# For config.h.
include_dirs = [ "." ]
configs += [ ":suppress_warnings" ]
public_deps = [ ":headers" ]
deps = [ "//sdk/lib/fit" ]
}
library_headers("headers") {
headers = [
"pcap/bpf.h",
"pcap/can_socketcan.h",
"pcap/compiler-tests.h",
"pcap/dlt.h",
"pcap/funcattrs.h",
"pcap/ipnet.h",
"pcap/namedb.h",
"pcap/nflog.h",
"pcap/pcap.h",
"pcap/pcap-inttypes.h",
"pcap/sll.h",
"pcap/socket.h",
"pcap/usb.h",
]
include_dir = "./src"
}
config("suppress_warnings") {
visibility = [ ":*" ]
cflags = [
"-Wno-implicit-fallthrough",
"-Wno-int-conversion",
]
}