-
Notifications
You must be signed in to change notification settings - Fork 253
/
BUILD.bazel
59 lines (54 loc) · 1.84 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
load("//bazel/config:copt.bzl", "ASYNC_SIMPLE_COPTS")
uthread_prefix = "async_simple/uthread/internal/"
uthread_srcs = [
] + select({
"//bazel/config:async_simple_with_uthread": [
"async_simple/uthread/internal/thread_impl.h",
"async_simple/uthread/internal/thread.cc",
],
"//conditions:default": [],
}) + select({
"//bazel/config:linux_x86_64": glob([uthread_prefix + "Linux/" + "x86_64/*.S"]),
"//bazel/config:linux_aarch64": glob([uthread_prefix + "Linux/" + "aarch64/*.S"]),
"//bazel/config:linux_ppc64le": glob([uthread_prefix + "Linux/" + "ppc64le/*.S"]),
"//bazel/config:darwin_x86_64": glob([uthread_prefix + "Darwin/" + "x86_64/*.S"]),
"//bazel/config:darwin_aarch64": glob([uthread_prefix + "Darwin/" + "arm64/*.S"]),
"//conditions:default": [],
})
uthread_hdrs = select({
"//bazel/config:async_simple_with_uthread": glob([
"async_simple/uthread/internal/*.h",
"async_simple/uthread/*.h",
]),
"//conditions:default": [],
})
cc_library(
name = "simple_executors",
hdrs = glob(["async_simple/executors/*.h"]),
defines = select({
"//bazel/config:async_simple_has_not_aio": ["ASYNC_SIMPLE_HAS_NOT_AIO"],
"//conditions:default": [],
}),
linkopts = select({
"//bazel/config:async_simple_has_not_aio": [],
"//conditions:default": ["-laio"],
}),
visibility = ["//visibility:public"],
)
cc_library(
name = "async_simple",
srcs = [
"async_simple/experimental/coroutine.h",
] + uthread_srcs,
hdrs = glob([
"async_simple/*.h",
"async_simple/coro/*.h",
"async_simple/util/*.h",
]) + uthread_hdrs,
copts = ASYNC_SIMPLE_COPTS,
linkopts = select({
"@platforms//os:windows": [],
"//conditions:default": ["-lpthread"],
}),
visibility = ["//visibility:public"],
)