forked from boostorg/chrono
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD.bazel
90 lines (81 loc) · 2.15 KB
/
BUILD.bazel
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
load("@rules_cc//cc:defs.bzl", "cc_library")
package(default_visibility = ["//visibility:public"])
_WINDOWS_HDRS = [
"**/win/*.hpp"
]
_POSIX_HDRS = [
"**/posix/*.hpp"
]
_MAC_HDRS = [
"**/mac/*.hpp"
]
cc_library(
name = "chrono_posix",
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"@platforms//os:macos": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
hdrs = glob(_POSIX_HDRS),
includes = ["include"],
defines = ["BOOST_THREAD_DONT_USE_ATOMIC"],
)
cc_library(
name = "chrono_windows",
target_compatible_with = select({
"@platforms//os:windows": [],
"@platforms//os:macos": ["@platforms//:incompatible"],
"//conditions:default": ["@platforms//:incompatible"],
}),
hdrs = glob(_WINDOWS_HDRS),
includes = ["include"],
linkopts = ["-DEFAULTLIB:shell32"],
)
cc_library(
name = "chrono_mac",
target_compatible_with = select({
"@platforms//os:windows": ["@platforms//:incompatible"],
"@platforms//os:macos": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
hdrs = glob(_MAC_HDRS),
includes = ["include"],
linkopts = ["-DEFAULTLIB:shell32"],
)
cc_library(
name = "boost.chrono",
hdrs = glob([
"include/**/*.hpp",
"include/**/*.h",
], exclude = _POSIX_HDRS + _WINDOWS_HDRS + _MAC_HDRS),
srcs = glob(["src/**/*.cpp"]),
defines = ["BOOST_ALL_NO_LIB"],
includes = ["include"],
deps = [
"@boost.assert",
"@boost.config",
"@boost.core",
"@boost.integer",
"@boost.move",
"@boost.mpl",
"@boost.predef",
"@boost.ratio",
"@boost.static_assert",
"@boost.system",
"@boost.throw_exception",
"@boost.type_traits",
"@boost.typeof",
"@boost.utility",
] + select({
"@platforms//os:windows": [
":chrono_windows",
"@boost.winapi",
],
"@platforms//os:macos": [
":chrono_mac",
],
"//conditions:default": [
":chrono_posix",
],
})
)