|
| 1 | +load("@rules_cc//cc:defs.bzl", "cc_library") |
| 2 | + |
| 3 | +LIBUV_COMMON_SRCS = [ |
| 4 | + "third_party/libuv/src/fs-poll.c", |
| 5 | + "third_party/libuv/src/idna.c", |
| 6 | + "third_party/libuv/src/inet.c", |
| 7 | + "third_party/libuv/src/strscpy.c", |
| 8 | + "third_party/libuv/src/threadpool.c", |
| 9 | + "third_party/libuv/src/timer.c", |
| 10 | + "third_party/libuv/src/uv-data-getter-setters.c", |
| 11 | + "third_party/libuv/src/uv-common.c", |
| 12 | + "third_party/libuv/src/version.c", |
| 13 | +] |
| 14 | + |
| 15 | +LIBUV_POSIX_SRCS = [ |
| 16 | + "third_party/libuv/src/unix/async.c", |
| 17 | + "third_party/libuv/src/unix/core.c", |
| 18 | + "third_party/libuv/src/unix/dl.c", |
| 19 | + "third_party/libuv/src/unix/fs.c", |
| 20 | + "third_party/libuv/src/unix/getaddrinfo.c", |
| 21 | + "third_party/libuv/src/unix/getnameinfo.c", |
| 22 | + "third_party/libuv/src/unix/loop.c", |
| 23 | + "third_party/libuv/src/unix/loop-watcher.c", |
| 24 | + "third_party/libuv/src/unix/pipe.c", |
| 25 | + "third_party/libuv/src/unix/poll.c", |
| 26 | + "third_party/libuv/src/unix/process.c", |
| 27 | + "third_party/libuv/src/unix/signal.c", |
| 28 | + "third_party/libuv/src/unix/stream.c", |
| 29 | + "third_party/libuv/src/unix/tcp.c", |
| 30 | + "third_party/libuv/src/unix/thread.c", |
| 31 | + "third_party/libuv/src/unix/tty.c", |
| 32 | + "third_party/libuv/src/unix/udp.c", |
| 33 | +] |
| 34 | + |
| 35 | +LIBUV_LINUX_SRCS = LIBUV_POSIX_SRCS + [ |
| 36 | + "third_party/libuv/src/unix/linux-core.c", |
| 37 | + "third_party/libuv/src/unix/linux-inotify.c", |
| 38 | + "third_party/libuv/src/unix/linux-syscalls.c", |
| 39 | + "third_party/libuv/src/unix/procfs-exepath.c", |
| 40 | + "third_party/libuv/src/unix/sysinfo-loadavg.c", |
| 41 | +] |
| 42 | + |
| 43 | +cc_library( |
| 44 | + name = "libuv", |
| 45 | + srcs = LIBUV_COMMON_SRCS + LIBUV_LINUX_SRCS, |
| 46 | + includes = [ |
| 47 | + "third_party/libuv/include", |
| 48 | + "third_party/libuv/src", |
| 49 | + ], |
| 50 | + hdrs = glob( |
| 51 | + [ |
| 52 | + "third_party/libuv/include/*.h", |
| 53 | + "third_party/libuv/include/uv/*.h", |
| 54 | + "third_party/libuv/src/*.h", |
| 55 | + "third_party/libuv/src/unix/*.h", |
| 56 | + ], |
| 57 | + ), |
| 58 | + visibility = ["//visibility:public"], |
| 59 | +) |
| 60 | + |
| 61 | +proto_library( |
| 62 | + name = "tensorpipe_proto_source", |
| 63 | + srcs = glob([ |
| 64 | + "tensorpipe/proto/*.proto", |
| 65 | + "tensorpipe/proto/*/*.proto", |
| 66 | + ]), |
| 67 | + visibility = ["//visibility:public"], |
| 68 | +) |
| 69 | + |
| 70 | +cc_proto_library( |
| 71 | + name = "tensorpipe_protos", |
| 72 | + deps = [":tensorpipe_proto_source"], |
| 73 | +) |
| 74 | + |
| 75 | +cc_library( |
| 76 | + name = "tensorpipe", |
| 77 | + srcs = glob( |
| 78 | + [ |
| 79 | + "tensorpipe/*.cc", |
| 80 | + "tensorpipe/channel/*.cc", |
| 81 | + "tensorpipe/channel/*/*.cc", |
| 82 | + "tensorpipe/common/*.cc", |
| 83 | + "tensorpipe/core/*.cc", |
| 84 | + "tensorpipe/transport/*.cc", |
| 85 | + "tensorpipe/transport/*/*.cc", |
| 86 | + "tensorpipe/util/*/*.cc", |
| 87 | + ], |
| 88 | + ), |
| 89 | + hdrs = glob( |
| 90 | + [ |
| 91 | + "tensorpipe/*.h", |
| 92 | + "tensorpipe/channel/*.h", |
| 93 | + "tensorpipe/channel/*/*.h", |
| 94 | + "tensorpipe/common/*.h", |
| 95 | + "tensorpipe/core/*.h", |
| 96 | + "tensorpipe/transport/*.h", |
| 97 | + "tensorpipe/transport/*/*.h", |
| 98 | + "tensorpipe/util/*/*.h", |
| 99 | + ], |
| 100 | + ), |
| 101 | + includes = [ |
| 102 | + ".", |
| 103 | + ], |
| 104 | + copts = [ |
| 105 | + "-std=c++14", |
| 106 | + ], |
| 107 | + visibility = ["//visibility:public"], |
| 108 | + deps = [":tensorpipe_protos", ":libuv"], |
| 109 | +) |
0 commit comments