# Copyright 2026 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== # Description: # libuv is a cross-platform asynchronous I/O library. package( default_visibility = ["//visibility:public"], ) licenses(["notice"]) exports_files(["LICENSE"]) cc_library( name = "uv", srcs = [ "src/fs-poll.c", "src/idna.c", "src/inet.c", "src/random.c", "src/strscpy.c", "src/threadpool.c", "src/timer.c", "src/uv-common.c", "src/uv-data-getter-setters.c", "src/version.c", ] + [ "src/unix/async.c", "src/unix/core.c", "src/unix/dl.c", "src/unix/fs.c", "src/unix/getaddrinfo.c", "src/unix/getnameinfo.c", "src/unix/loop.c", "src/unix/loop-watcher.c", "src/unix/pipe.c", "src/unix/poll.c", "src/unix/process.c", "src/unix/random-devurandom.c", "src/unix/signal.c", "src/unix/stream.c", "src/unix/tcp.c", "src/unix/thread.c", "src/unix/tty.c", "src/unix/udp.c", ] + select({ "@platforms//os:osx": [ "src/unix/bsd-ifaddrs.c", "src/unix/darwin.c", "src/unix/darwin-proctitle.c", "src/unix/fsevents.c", "src/unix/kqueue.c", "src/unix/proctitle.c", "src/unix/random-getentropy.c", ], "//conditions:default": [], }), # TODO: Add Linux, etc. as in https://github.com/libuv/libuv/blob/v1.38.0/CMakeLists.txt. hdrs = [ "include/uv.h", "src/heap-inl.h", "src/idna.h", "src/queue.h", "src/strscpy.h", "src/unix/atomic-ops.h", "src/unix/internal.h", "src/unix/spinlock.h", "src/uv-common.h", ] + select({ "@platforms//os:osx": [ "src/unix/darwin-stub.h", ], "//conditions:default": [], }) + glob(["include/uv/*.h"]), copts = [ "-fexceptions", "-Wno-unused-variable", ], includes = [ "include", "src", ], textual_hdrs = [ "include/uv.h", ], )