aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/native/BUILD.bazel
blob: 91d6f8cd6a64e1ee84f7526e0c476eabc99240ae (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
load("//bazel:cc.bzl", "cc_shared_library")

cc_shared_library(
    name = "native_asan",
    srcs = [
        "com_example_ExampleFuzzerWithNative.cpp",
        "com_example_ExampleFuzzerWithNative.h",
    ],
    copts = [
        "-fsanitize=fuzzer-no-link,address",
    ],
    linkopts = select({
        "//:clang_on_linux": ["-fuse-ld=lld"],
        "//conditions:default": [],
    }),
    visibility = ["//examples:__pkg__"],
    deps = [
        "@bazel_tools//tools/jdk:jni",
    ],
)

cc_shared_library(
    name = "native_ubsan",
    srcs = [
        "com_example_ExampleFuzzerWithNative.cpp",
        "com_example_ExampleFuzzerWithNative.h",
    ],
    copts = [
        "-fsanitize=fuzzer-no-link,undefined",
        "-fno-sanitize-recover=all",
    ],
    linkopts = select({
        "//:clang_on_linux": ["-fuse-ld=lld"],
        "//conditions:default": [],
    }),
    visibility = ["//examples:__pkg__"],
    deps = [
        "@bazel_tools//tools/jdk:jni",
    ],
)