aboutsummaryrefslogtreecommitdiff
path: root/tests/src/test/native/com/example/BUILD.bazel
blob: 93b886a8a8897779beaf2f41be3a33f59f518a4b (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
load("@fmeum_rules_jni//jni:defs.bzl", "cc_jni_library")

cc_jni_library(
    name = "native_value_profile_fuzzer",
    srcs = ["native_value_profile_fuzzer.cpp"],
    copts = [
        "-fsanitize=fuzzer-no-link,address",
        "-fno-sanitize-blacklist",
    ],
    defines = [
        # Workaround for Windows build failures with VS 2022:
        # "lld-link: error: /INFERASANLIBS is not allowed in .drectve"
        # https://github.com/llvm/llvm-project/issues/56300#issuecomment-1214313292
        "_DISABLE_STRING_ANNOTATION=1",
        "_DISABLE_VECTOR_ANNOTATION=1",
    ],
    linkopts = select({
        "//:clang_on_linux": ["-fuse-ld=lld"],
        "@platforms//os:windows": [
            # Windows requires all symbols that should be imported from the main
            # executable to be defined by an import lib.
            "/wholearchive:clang_rt.asan_dll_thunk-x86_64.lib",
        ],
        "//conditions:default": [],
    }),
    visibility = ["//tests:__pkg__"],
    deps = ["//tests:native_value_profile_fuzzer.hdrs"],
)