Skip to content

Commit

Permalink
build: add GN build files
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon authored and codebytere committed Oct 2, 2018
1 parent db067ff commit 88b4941
Show file tree
Hide file tree
Showing 8 changed files with 1,198 additions and 1 deletion.
660 changes: 660 additions & 0 deletions BUILD.gn

Large diffs are not rendered by default.

125 changes: 125 additions & 0 deletions deps/cares/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
config("cares_config") {
include_dirs = [ "include" ]
}
static_library("cares") {
defines = [ "CARES_STATICLIB" ]
include_dirs = [
"include",
"src",
]
public_configs = [ ":cares_config" ]

libs = []
cflags_c = [
"-Wno-logical-not-parentheses",
"-Wno-sign-compare",
]

sources = [
"include/ares.h",
"include/ares_rules.h",
"include/ares_version.h",
"include/nameser.h",
"src/ares__close_sockets.c",
"src/ares__get_hostent.c",
"src/ares__read_line.c",
"src/ares__timeval.c",
"src/ares_android.c",
"src/ares_cancel.c",
"src/ares_create_query.c",
"src/ares_data.c",
"src/ares_data.h",
"src/ares_destroy.c",
"src/ares_dns.h",
"src/ares_expand_name.c",
"src/ares_expand_string.c",
"src/ares_fds.c",
"src/ares_free_hostent.c",
"src/ares_free_string.c",
"src/ares_getenv.h",
"src/ares_gethostbyaddr.c",
"src/ares_gethostbyname.c",
"src/ares_getnameinfo.c",
"src/ares_getopt.c",
"src/ares_getopt.h",
"src/ares_getsock.c",
"src/ares_inet_net_pton.h",
"src/ares_init.c",
"src/ares_ipv6.h",
"src/ares_library_init.c",
"src/ares_library_init.h",
"src/ares_llist.c",
"src/ares_llist.h",
"src/ares_mkquery.c",
"src/ares_nowarn.c",
"src/ares_nowarn.h",
"src/ares_options.c",
"src/ares_parse_a_reply.c",
"src/ares_parse_aaaa_reply.c",
"src/ares_parse_mx_reply.c",
"src/ares_parse_naptr_reply.c",
"src/ares_parse_ns_reply.c",
"src/ares_parse_ptr_reply.c",
"src/ares_parse_soa_reply.c",
"src/ares_parse_srv_reply.c",
"src/ares_parse_txt_reply.c",
"src/ares_platform.h",
"src/ares_private.h",
"src/ares_process.c",
"src/ares_query.c",
"src/ares_search.c",
"src/ares_send.c",
"src/ares_setup.h",
"src/ares_strcasecmp.c",
"src/ares_strcasecmp.h",
"src/ares_strdup.c",
"src/ares_strdup.h",
"src/ares_strerror.c",
"src/ares_timeout.c",
"src/ares_version.c",
"src/ares_writev.c",
"src/ares_writev.h",
"src/bitncmp.c",
"src/bitncmp.h",
"src/inet_net_pton.c",
"src/inet_ntop.c",
"src/setup_once.h",
]

if (!is_win) {
defines += [
"_DARWIN_USE_64_BIT_INODE=1",
"_LARGEFILE_SOURCE",
"_FILE_OFFSET_BITS=64",
"_GNU_SOURCE",
]
}

if (is_win) {
defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
include_dirs += [ "config/win32" ]
sources += [
"src/ares_getenv.c",
"src/ares_iphlpapi.h",
"src/ares_platform.c",
"src/config-win32.h",
"src/windows_port.c",
]
libs += [
"ws2_32.lib",
"iphlpapi.lib",
]
} else {
defines += [ "HAVE_CONFIG_H" ]
}

if (is_linux) {
include_dirs += [ "config/linux" ]
sources += [ "config/linux/ares_config.h" ]
}

if (is_mac) {
include_dirs += [ "config/darwin" ]
sources += [ "config/darwin/ares_config.h" ]
}
}
13 changes: 13 additions & 0 deletions deps/http_parser/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
config("http_parser_config") {
defines = [ "HTTP_PARSER_STRICT=0" ]
include_dirs = [ "." ]
}

static_library("http_parser") {
include_dirs = [ "." ]
public_configs = [ ":http_parser_config" ]
cflags_c = [ "-Wno-string-conversion" ]
sources = [
"http_parser.c",
]
}
43 changes: 43 additions & 0 deletions deps/nghttp2/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
config("nghttp2_config") {
defines = [ "NGHTTP2_STATICLIB" ]
include_dirs = [ "lib/includes" ]
}
static_library("nghttp2") {
public_configs = [ ":nghttp2_config" ]
defines = [
"_U_",
"BUILDING_NGHTTP2",
"NGHTTP2_STATICLIB",
]
include_dirs = [ "lib/includes" ]
if (is_win) {
defines += [ "HAVE_CONFIG_H" ]
}

cflags_c = [ "-Wno-implicit-function-declaration" ]

sources = [
"lib/nghttp2_buf.c",
"lib/nghttp2_callbacks.c",
"lib/nghttp2_debug.c",
"lib/nghttp2_frame.c",
"lib/nghttp2_hd.c",
"lib/nghttp2_hd_huffman.c",
"lib/nghttp2_hd_huffman_data.c",
"lib/nghttp2_helper.c",
"lib/nghttp2_http.c",
"lib/nghttp2_map.c",
"lib/nghttp2_mem.c",
"lib/nghttp2_npn.c",
"lib/nghttp2_option.c",
"lib/nghttp2_outbound_item.c",
"lib/nghttp2_pq.c",
"lib/nghttp2_priority_spec.c",
"lib/nghttp2_queue.c",
"lib/nghttp2_rcbuf.c",
"lib/nghttp2_session.c",
"lib/nghttp2_stream.c",
"lib/nghttp2_submit.c",
"lib/nghttp2_version.c",
]
}
186 changes: 186 additions & 0 deletions deps/uv/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
config("libuv_config") {
include_dirs = [ "include" ]

defines = []

if (is_linux) {
defines += [ "_POSIX_C_SOURCE=200112" ]
}
if (!is_win) {
defines += [
"_LARGEFILE_SOURCE",
"_FILE_OFFSET_BITS=64",
]
}
if (is_mac) {
defines += [ "_DARWIN_USE_64_BIT_INODE=1" ]
}
}

static_library("uv") {
include_dirs = [
"include",
"src",
]

public_configs = [ ":libuv_config" ]

ldflags = []

defines = []

cflags_c = [
"-Wno-bitwise-op-parentheses",
"-Wno-implicit-function-declaration",
"-Wno-missing-braces",
"-Wno-sign-compare",
"-Wno-sometimes-uninitialized",
"-Wno-string-conversion",
"-Wno-switch",
"-Wno-unused-function",
"-Wno-unused-variable",
]

libs = []

sources = [
"include/uv.h",
"include/uv/errno.h",
"include/uv/threadpool.h",
"include/uv/tree.h",
"include/uv/version.h",
"src/fs-poll.c",
"src/heap-inl.h",
"src/inet.c",
"src/queue.h",
"src/threadpool.c",
"src/timer.c",
"src/uv-common.c",
"src/uv-common.h",
"src/uv-data-getter-setters.c",
"src/version.c"
]

if (is_win) {
defines += [
"_GNU_SOURCE",
]
sources += [
"include/uv/win.h",
"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/req.c",
"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",
]
libs += [
"advapi32.lib",
"iphlpapi.lib",
"psapi.lib",
"shell32.lib",
"user32.lib",
"userenv.lib",
"ws2_32.lib",
]
} else {
sources += [
"include/uv/aix.h",
"include/uv/bsd.h",
"include/uv/darwin.h",
"include/uv/linux.h",
"include/uv/sunos.h",
"include/uv/unix.h",
"src/unix/async.c",
"src/unix/atomic-ops.h",
"src/unix/core.c",
"src/unix/dl.c",
"src/unix/fs.c",
"src/unix/getaddrinfo.c",
"src/unix/getnameinfo.c",
"src/unix/internal.h",
"src/unix/loop-watcher.c",
"src/unix/loop.c",
"src/unix/pipe.c",
"src/unix/poll.c",
"src/unix/process.c",
"src/unix/signal.c",
"src/unix/spinlock.h",
"src/unix/stream.c",
"src/unix/tcp.c",
"src/unix/thread.c",
"src/unix/tty.c",
"src/unix/udp.c",
]
libs += [ "m" ]
ldflags += [ "-pthread" ]
}
if (is_mac || is_linux) {
sources += [ "src/unix/proctitle.c" ]
}
if (is_mac) {
sources += [
"src/unix/darwin-proctitle.c",
"src/unix/darwin.c",
"src/unix/fsevents.c",
]
defines += [
"_DARWIN_USE_64_BIT_INODE=1",
"_DARWIN_UNLIMITED_SELECT=1",
]
}
if (is_linux) {
defines += [ "_GNU_SOURCE" ]
sources += [
"src/unix/linux-core.c",
"src/unix/linux-inotify.c",
"src/unix/linux-syscalls.c",
"src/unix/linux-syscalls.h",
"src/unix/procfs-exepath.c",
"src/unix/sysinfo-loadavg.c",
"src/unix/sysinfo-memory.c",
]
libs += [
"dl",
"rt",
]
}
if (is_mac) { # is_bsd
sources += [
"src/unix/bsd-ifaddrs.c",
"src/unix/kqueue.c",
]
}
if (is_component_build && is_win) {
defines += [
"BUILDING_UV_SHARED=1",
]
}
}
Loading

0 comments on commit 88b4941

Please sign in to comment.