xref: /aosp_15_r20/external/cpuinfo/deps/clog/BUILD.bazel (revision 2b54f0db79fd8303838913b20ff3780cddaa909f)
1# Copied from TensorFlow's `https://github.com/tensorflow/tensorflow/blob/master/third_party/clog/clog.BUILD
2# Licenced under Apache-2.0 License
3
4# Description:
5#   C-style (a-la printf) logging library
6
7package(default_visibility = ["//visibility:public"])
8
9licenses(["notice"])
10
11exports_files(["LICENSE"])
12
13cc_library(
14    name = "clog",
15    srcs = [
16        "src/clog.c",
17    ],
18    hdrs = [
19        "include/clog.h",
20    ],
21    copts = select({
22        ":windows": [],
23        "//conditions:default": ["-Wno-unused-result"],
24    }),
25    defines = select({
26        # When linkstatic=False, we need default visibility
27        ":macos_x86_64": ["CLOG_VISIBILITY="],
28        "//conditions:default": [],
29    }),
30    linkopts = select({
31        ":android": ["-llog"],
32        "//conditions:default": [],
33    }),
34    linkstatic = select({
35        # https://github.com/bazelbuild/bazel/issues/11552
36        ":macos_x86_64": False,
37        "//conditions:default": True,
38    }),
39    strip_include_prefix = "include",
40)
41
42config_setting(
43    name = "android",
44    values = {"crosstool_top": "//external:android/crosstool"},
45)
46
47config_setting(
48    name = "windows",
49    values = {"cpu": "x64_windows"},
50)
51
52config_setting(
53    name = "macos_x86_64",
54    values = {
55        "apple_platform_type": "macos",
56        "cpu": "darwin",
57    },
58)
59