File: BUILD

package info (click to toggle)
rust-codspeed 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,560 kB
  • sloc: ansic: 9,768; sh: 6; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 1,443 bytes parent folder | download | duplicates (2)
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
41
42
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")

config_setting(
    name = "windows",
    constraint_values = ["@platforms//os:windows"],
)

# Instrument-hooks library with warning suppressions
cc_library(
    name = "instrument_hooks",
    srcs = ["instrument-hooks/dist/core.c"],
    hdrs = glob(["instrument-hooks/includes/*.h"]),
    includes = ["instrument-hooks/includes"],
    copts = select({
        ":windows": [
            "/wd4101",  # unreferenced local variable (equivalent to -Wno-unused-variable)
            "/wd4189",  # local variable is initialized but not referenced (equivalent to -Wno-unused-but-set-variable)
            "/wd4100",  # unreferenced formal parameter (equivalent to -Wno-unused-parameter)
            "/wd4245",  # signed/unsigned mismatch
            "/wd4132",  # const object should be initialized
            "/wd4146",  # unary minus operator applied to unsigned type
        ],
        "//conditions:default": [
            "-Wno-maybe-uninitialized",
            "-Wno-unused-variable",
            "-Wno-unused-parameter",
            "-Wno-unused-but-set-variable",
            "-Wno-type-limits",
        ],
    }),
    visibility = ["//visibility:public"],
)

cc_binary(
    name = "example",
    srcs = ["main.c"],
    deps = [":instrument_hooks"],
    copts = select({
        ":windows": ["/W4", "/WX"],
        "//conditions:default": ["-Wall", "-Wextra", "-Werror"],
    }),
)