1// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15filegroup {
16    name: "vts_proto_fuzzer_srcs",
17    srcs: [
18        "ProtoFuzzerMain.cpp",
19        "ProtoFuzzerMutateFns.cpp",
20        "ProtoFuzzerMutator.cpp",
21        "ProtoFuzzerRunner.cpp",
22        "ProtoFuzzerStaticParams.cpp",
23        "ProtoFuzzerStats.cpp",
24        "ProtoFuzzerUtils.cpp",
25    ],
26}
27
28cc_defaults {
29    name: "vts_proto_fuzzer_default",
30    srcs: [
31        ":vts_proto_fuzzer_srcs",
32    ],
33    include_dirs: [
34        "external/llvm/lib/Fuzzer",
35        "test/vts/drivers/hal/common/include",
36        "test/vts-testcase/fuzz/iface_fuzzer/include",
37    ],
38    shared_libs: [
39        "libbase",
40        "libprotobuf-cpp-full",
41        "libvintf",
42        "libvts_common",
43        "libvts_multidevice_proto",
44        "libvts_proto_fuzzer_proto",
45    ],
46    static_libs: [
47        "libhidl-gen-utils",
48    ],
49    cflags: [
50        "-Wall",
51        "-Werror",
52        "-Wno-unused-parameter",
53        "-Wno-macro-redefined",
54        "-Wno-extra-tokens",
55        "-Wno-c99-extensions",
56        "-fno-omit-frame-pointer",
57    ],
58    fuzz_config: {
59        // This fuzz target must be run against HAL implementation, which are
60        // only present on the device. These are disabled for until Haiku has
61        // improved support for fuzzing HAL services.
62        fuzz_on_haiku_device: false,
63        fuzz_on_haiku_host: false,
64        cc: [
65            "smoreland@google.com",
66            "trong@google.com",
67        ],
68    },
69}
70
71cc_fuzz {
72    name: "vts_proto_fuzzer",
73    defaults: ["vts_proto_fuzzer_default"],
74}
75