Skip to content

Instantly share code, notes, and snippets.

@knopp
Created January 9, 2019 06:12
Show Gist options
  • Save knopp/74eb210376aa86effde686544ac06576 to your computer and use it in GitHub Desktop.
Save knopp/74eb210376aa86effde686544ac06576 to your computer and use it in GitHub Desktop.
import("//build/config/bundle.gni")
config("libuv_config") {
defines = ["USING_UV_SHARED"]
include_dirs = ["include"]
}
source_set("libuv_sources")
{
if (is_win) {
set_sources_assignment_filter([
"*darwin*",
"*unix*",
"*linux*",
"*sunos*",
"*msvc*",
"*android*",
])
} else {
set_sources_assignment_filter([
"*win/*", # *win* would match darwin as well
"*-win*",
"*aix*",
"*openbsd*",
"*freebsd*",
"*netbsd*",
"*linux*",
"*bsd-proctitle*",
"*sunos*",
"*msvc*",
"*android*",
"*os390*",
"*cygwin*",
"*posix*",
"*sysinfo*",
"*no-*",
"*procfs*",
"*ibm*",
])
}
sources=[
"include/uv/aix.h",
"include/uv/android-ifaddrs.h",
"include/uv/bsd.h",
"include/uv/darwin.h",
"include/uv/errno.h",
"include/uv/linux.h",
"include/uv/os390.h",
"include/uv/posix.h",
"include/uv/stdint-msvc2008.h",
"include/uv/sunos.h",
"include/uv/threadpool.h",
"include/uv/tree.h",
"include/uv/unix.h",
"include/uv/version.h",
"include/uv/win.h",
"include/uv.h",
"src/version.c",
"src/unix/aix-common.c",
"src/unix/aix.c",
"src/unix/android-ifaddrs.c",
"src/unix/async.c",
"src/unix/atomic-ops.h",
"src/unix/bsd-ifaddrs.c",
"src/unix/bsd-proctitle.c",
"src/unix/core.c",
"src/unix/cygwin.c",
"src/unix/darwin-proctitle.c",
"src/unix/darwin.c",
"src/unix/dl.c",
"src/unix/freebsd.c",
"src/unix/fs.c",
"src/unix/fsevents.c",
"src/unix/getaddrinfo.c",
"src/unix/getnameinfo.c",
"src/unix/ibmi.c",
"src/unix/internal.h",
"src/unix/kqueue.c",
"src/unix/linux-core.c",
"src/unix/linux-inotify.c",
"src/unix/linux-syscalls.c",
"src/unix/linux-syscalls.h",
"src/unix/loop-watcher.c",
"src/unix/loop.c",
"src/unix/netbsd.c",
"src/unix/no-fsevents.c",
"src/unix/no-proctitle.c",
"src/unix/openbsd.c",
"src/unix/os390-syscalls.c",
"src/unix/os390-syscalls.h",
"src/unix/os390.c",
"src/unix/pipe.c",
"src/unix/poll.c",
"src/unix/posix-hrtime.c",
"src/unix/posix-poll.c",
"src/unix/process.c",
"src/unix/procfs-exepath.c",
"src/unix/proctitle.c",
"src/unix/pthread-fixes.c",
"src/unix/signal.c",
"src/unix/spinlock.h",
"src/unix/stream.c",
"src/unix/sunos.c",
"src/unix/sysinfo-loadavg.c",
"src/unix/sysinfo-memory.c",
"src/unix/tcp.c",
"src/unix/thread.c",
"src/unix/tty.c",
"src/unix/udp.c",
"src/win/async.c",
"src/win/atomicops-inl.h",
"src/win/core.c",
"src/win/detect-wakeup.c",
"src/win/dl.c",
"src/win/error.c",
"src/win/fs-event.c",
"src/win/fs.c",
"src/win/getaddrinfo.c",
"src/win/getnameinfo.c",
"src/win/handle-inl.h",
"src/win/handle.c",
"src/win/internal.h",
"src/win/loop-watcher.c",
"src/win/pipe.c",
"src/win/poll.c",
"src/win/process-stdio.c",
"src/win/process.c",
"src/win/req-inl.h",
"src/win/signal.c",
"src/win/snprintf.c",
"src/win/stream-inl.h",
"src/win/stream.c",
"src/win/tcp.c",
"src/win/thread.c",
"src/win/tty.c",
"src/win/udp.c",
"src/win/util.c",
"src/win/winapi.c",
"src/win/winapi.h",
"src/win/winsock.c",
"src/win/winsock.h",
"src/fs-poll.c",
"src/heap-inl.h",
"src/idna.c",
"src/idna.h",
"src/inet.c",
"src/queue.h",
"src/strscpy.c",
"src/strscpy.h",
"src/threadpool.c",
"src/timer.c",
"src/uv-common.c",
"src/uv-common.h",
"src/uv-data-getter-setters.c",
]
configs -= ["//build/config:default-warnings"]
configs += ["//build/config:contrib-warnings"]
defines = ["BUILDING_UV_SHARED"]
include_dirs = ["include", "src"]
}
bundle_shared_library("libuv") {
deps = [":libuv_sources"]
public_configs = [":libuv_config"]
if (is_posix) {
# otherwise bundle_shared_library outputs liblibuv
output_prefix_override = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment