aboutsummaryrefslogtreecommitdiff
path: root/deps/clog/BUILD.bazel
blob: 7dc52ea610e2c92023e0ddca8620ba3497243513 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copied from TensorFlow's `https://github.com/tensorflow/tensorflow/blob/master/third_party/clog/clog.BUILD
# Licenced under Apache-2.0 License

# Description:
#   C-style (a-la printf) logging library

package(default_visibility = ["//visibility:public"])

licenses(["notice"])

exports_files(["LICENSE"])

cc_library(
    name = "clog",
    srcs = [
        "src/clog.c",
    ],
    hdrs = [
        "include/clog.h",
    ],
    copts = select({
        ":windows": [],
        "//conditions:default": ["-Wno-unused-result"],
    }),
    defines = select({
        # When linkstatic=False, we need default visibility
        ":macos_x86_64": ["CLOG_VISIBILITY="],
        "//conditions:default": [],
    }),
    linkopts = select({
        ":android": ["-llog"],
        "//conditions:default": [],
    }),
    linkstatic = select({
        # https://github.com/bazelbuild/bazel/issues/11552
        ":macos_x86_64": False,
        "//conditions:default": True,
    }),
    strip_include_prefix = "include",
)

config_setting(
    name = "android",
    values = {"crosstool_top": "//external:android/crosstool"},
)

config_setting(
    name = "windows",
    values = {"cpu": "x64_windows"},
)

config_setting(
    name = "macos_x86_64",
    values = {
        "apple_platform_type": "macos",
        "cpu": "darwin",
    },
)