Skip to content

Commit 88b4941

Browse files
nornagoncodebytere
authored andcommitted
build: add GN build files
1 parent db067ff commit 88b4941

File tree

8 files changed

+1198
-1
lines changed

8 files changed

+1198
-1
lines changed

BUILD.gn

+660
Large diffs are not rendered by default.

deps/cares/BUILD.gn

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
config("cares_config") {
2+
include_dirs = [ "include" ]
3+
}
4+
static_library("cares") {
5+
defines = [ "CARES_STATICLIB" ]
6+
include_dirs = [
7+
"include",
8+
"src",
9+
]
10+
public_configs = [ ":cares_config" ]
11+
12+
libs = []
13+
cflags_c = [
14+
"-Wno-logical-not-parentheses",
15+
"-Wno-sign-compare",
16+
]
17+
18+
sources = [
19+
"include/ares.h",
20+
"include/ares_rules.h",
21+
"include/ares_version.h",
22+
"include/nameser.h",
23+
"src/ares__close_sockets.c",
24+
"src/ares__get_hostent.c",
25+
"src/ares__read_line.c",
26+
"src/ares__timeval.c",
27+
"src/ares_android.c",
28+
"src/ares_cancel.c",
29+
"src/ares_create_query.c",
30+
"src/ares_data.c",
31+
"src/ares_data.h",
32+
"src/ares_destroy.c",
33+
"src/ares_dns.h",
34+
"src/ares_expand_name.c",
35+
"src/ares_expand_string.c",
36+
"src/ares_fds.c",
37+
"src/ares_free_hostent.c",
38+
"src/ares_free_string.c",
39+
"src/ares_getenv.h",
40+
"src/ares_gethostbyaddr.c",
41+
"src/ares_gethostbyname.c",
42+
"src/ares_getnameinfo.c",
43+
"src/ares_getopt.c",
44+
"src/ares_getopt.h",
45+
"src/ares_getsock.c",
46+
"src/ares_inet_net_pton.h",
47+
"src/ares_init.c",
48+
"src/ares_ipv6.h",
49+
"src/ares_library_init.c",
50+
"src/ares_library_init.h",
51+
"src/ares_llist.c",
52+
"src/ares_llist.h",
53+
"src/ares_mkquery.c",
54+
"src/ares_nowarn.c",
55+
"src/ares_nowarn.h",
56+
"src/ares_options.c",
57+
"src/ares_parse_a_reply.c",
58+
"src/ares_parse_aaaa_reply.c",
59+
"src/ares_parse_mx_reply.c",
60+
"src/ares_parse_naptr_reply.c",
61+
"src/ares_parse_ns_reply.c",
62+
"src/ares_parse_ptr_reply.c",
63+
"src/ares_parse_soa_reply.c",
64+
"src/ares_parse_srv_reply.c",
65+
"src/ares_parse_txt_reply.c",
66+
"src/ares_platform.h",
67+
"src/ares_private.h",
68+
"src/ares_process.c",
69+
"src/ares_query.c",
70+
"src/ares_search.c",
71+
"src/ares_send.c",
72+
"src/ares_setup.h",
73+
"src/ares_strcasecmp.c",
74+
"src/ares_strcasecmp.h",
75+
"src/ares_strdup.c",
76+
"src/ares_strdup.h",
77+
"src/ares_strerror.c",
78+
"src/ares_timeout.c",
79+
"src/ares_version.c",
80+
"src/ares_writev.c",
81+
"src/ares_writev.h",
82+
"src/bitncmp.c",
83+
"src/bitncmp.h",
84+
"src/inet_net_pton.c",
85+
"src/inet_ntop.c",
86+
"src/setup_once.h",
87+
]
88+
89+
if (!is_win) {
90+
defines += [
91+
"_DARWIN_USE_64_BIT_INODE=1",
92+
"_LARGEFILE_SOURCE",
93+
"_FILE_OFFSET_BITS=64",
94+
"_GNU_SOURCE",
95+
]
96+
}
97+
98+
if (is_win) {
99+
defines += [ "CARES_PULL_WS2TCPIP_H=1" ]
100+
include_dirs += [ "config/win32" ]
101+
sources += [
102+
"src/ares_getenv.c",
103+
"src/ares_iphlpapi.h",
104+
"src/ares_platform.c",
105+
"src/config-win32.h",
106+
"src/windows_port.c",
107+
]
108+
libs += [
109+
"ws2_32.lib",
110+
"iphlpapi.lib",
111+
]
112+
} else {
113+
defines += [ "HAVE_CONFIG_H" ]
114+
}
115+
116+
if (is_linux) {
117+
include_dirs += [ "config/linux" ]
118+
sources += [ "config/linux/ares_config.h" ]
119+
}
120+
121+
if (is_mac) {
122+
include_dirs += [ "config/darwin" ]
123+
sources += [ "config/darwin/ares_config.h" ]
124+
}
125+
}

deps/http_parser/BUILD.gn

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
config("http_parser_config") {
2+
defines = [ "HTTP_PARSER_STRICT=0" ]
3+
include_dirs = [ "." ]
4+
}
5+
6+
static_library("http_parser") {
7+
include_dirs = [ "." ]
8+
public_configs = [ ":http_parser_config" ]
9+
cflags_c = [ "-Wno-string-conversion" ]
10+
sources = [
11+
"http_parser.c",
12+
]
13+
}

deps/nghttp2/BUILD.gn

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
config("nghttp2_config") {
2+
defines = [ "NGHTTP2_STATICLIB" ]
3+
include_dirs = [ "lib/includes" ]
4+
}
5+
static_library("nghttp2") {
6+
public_configs = [ ":nghttp2_config" ]
7+
defines = [
8+
"_U_",
9+
"BUILDING_NGHTTP2",
10+
"NGHTTP2_STATICLIB",
11+
]
12+
include_dirs = [ "lib/includes" ]
13+
if (is_win) {
14+
defines += [ "HAVE_CONFIG_H" ]
15+
}
16+
17+
cflags_c = [ "-Wno-implicit-function-declaration" ]
18+
19+
sources = [
20+
"lib/nghttp2_buf.c",
21+
"lib/nghttp2_callbacks.c",
22+
"lib/nghttp2_debug.c",
23+
"lib/nghttp2_frame.c",
24+
"lib/nghttp2_hd.c",
25+
"lib/nghttp2_hd_huffman.c",
26+
"lib/nghttp2_hd_huffman_data.c",
27+
"lib/nghttp2_helper.c",
28+
"lib/nghttp2_http.c",
29+
"lib/nghttp2_map.c",
30+
"lib/nghttp2_mem.c",
31+
"lib/nghttp2_npn.c",
32+
"lib/nghttp2_option.c",
33+
"lib/nghttp2_outbound_item.c",
34+
"lib/nghttp2_pq.c",
35+
"lib/nghttp2_priority_spec.c",
36+
"lib/nghttp2_queue.c",
37+
"lib/nghttp2_rcbuf.c",
38+
"lib/nghttp2_session.c",
39+
"lib/nghttp2_stream.c",
40+
"lib/nghttp2_submit.c",
41+
"lib/nghttp2_version.c",
42+
]
43+
}

deps/uv/BUILD.gn

+186
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
config("libuv_config") {
2+
include_dirs = [ "include" ]
3+
4+
defines = []
5+
6+
if (is_linux) {
7+
defines += [ "_POSIX_C_SOURCE=200112" ]
8+
}
9+
if (!is_win) {
10+
defines += [
11+
"_LARGEFILE_SOURCE",
12+
"_FILE_OFFSET_BITS=64",
13+
]
14+
}
15+
if (is_mac) {
16+
defines += [ "_DARWIN_USE_64_BIT_INODE=1" ]
17+
}
18+
}
19+
20+
static_library("uv") {
21+
include_dirs = [
22+
"include",
23+
"src",
24+
]
25+
26+
public_configs = [ ":libuv_config" ]
27+
28+
ldflags = []
29+
30+
defines = []
31+
32+
cflags_c = [
33+
"-Wno-bitwise-op-parentheses",
34+
"-Wno-implicit-function-declaration",
35+
"-Wno-missing-braces",
36+
"-Wno-sign-compare",
37+
"-Wno-sometimes-uninitialized",
38+
"-Wno-string-conversion",
39+
"-Wno-switch",
40+
"-Wno-unused-function",
41+
"-Wno-unused-variable",
42+
]
43+
44+
libs = []
45+
46+
sources = [
47+
"include/uv.h",
48+
"include/uv/errno.h",
49+
"include/uv/threadpool.h",
50+
"include/uv/tree.h",
51+
"include/uv/version.h",
52+
"src/fs-poll.c",
53+
"src/heap-inl.h",
54+
"src/inet.c",
55+
"src/queue.h",
56+
"src/threadpool.c",
57+
"src/timer.c",
58+
"src/uv-common.c",
59+
"src/uv-common.h",
60+
"src/uv-data-getter-setters.c",
61+
"src/version.c"
62+
]
63+
64+
if (is_win) {
65+
defines += [
66+
"_GNU_SOURCE",
67+
]
68+
sources += [
69+
"include/uv/win.h",
70+
"src/win/async.c",
71+
"src/win/atomicops-inl.h",
72+
"src/win/core.c",
73+
"src/win/detect-wakeup.c",
74+
"src/win/dl.c",
75+
"src/win/error.c",
76+
"src/win/fs-event.c",
77+
"src/win/fs.c",
78+
"src/win/getaddrinfo.c",
79+
"src/win/getnameinfo.c",
80+
"src/win/handle-inl.h",
81+
"src/win/handle.c",
82+
"src/win/internal.h",
83+
"src/win/loop-watcher.c",
84+
"src/win/pipe.c",
85+
"src/win/poll.c",
86+
"src/win/process-stdio.c",
87+
"src/win/process.c",
88+
"src/win/req-inl.h",
89+
"src/win/req.c",
90+
"src/win/signal.c",
91+
"src/win/snprintf.c",
92+
"src/win/stream-inl.h",
93+
"src/win/stream.c",
94+
"src/win/tcp.c",
95+
"src/win/thread.c",
96+
"src/win/tty.c",
97+
"src/win/udp.c",
98+
"src/win/util.c",
99+
"src/win/winapi.c",
100+
"src/win/winapi.h",
101+
"src/win/winsock.c",
102+
"src/win/winsock.h",
103+
]
104+
libs += [
105+
"advapi32.lib",
106+
"iphlpapi.lib",
107+
"psapi.lib",
108+
"shell32.lib",
109+
"user32.lib",
110+
"userenv.lib",
111+
"ws2_32.lib",
112+
]
113+
} else {
114+
sources += [
115+
"include/uv/aix.h",
116+
"include/uv/bsd.h",
117+
"include/uv/darwin.h",
118+
"include/uv/linux.h",
119+
"include/uv/sunos.h",
120+
"include/uv/unix.h",
121+
"src/unix/async.c",
122+
"src/unix/atomic-ops.h",
123+
"src/unix/core.c",
124+
"src/unix/dl.c",
125+
"src/unix/fs.c",
126+
"src/unix/getaddrinfo.c",
127+
"src/unix/getnameinfo.c",
128+
"src/unix/internal.h",
129+
"src/unix/loop-watcher.c",
130+
"src/unix/loop.c",
131+
"src/unix/pipe.c",
132+
"src/unix/poll.c",
133+
"src/unix/process.c",
134+
"src/unix/signal.c",
135+
"src/unix/spinlock.h",
136+
"src/unix/stream.c",
137+
"src/unix/tcp.c",
138+
"src/unix/thread.c",
139+
"src/unix/tty.c",
140+
"src/unix/udp.c",
141+
]
142+
libs += [ "m" ]
143+
ldflags += [ "-pthread" ]
144+
}
145+
if (is_mac || is_linux) {
146+
sources += [ "src/unix/proctitle.c" ]
147+
}
148+
if (is_mac) {
149+
sources += [
150+
"src/unix/darwin-proctitle.c",
151+
"src/unix/darwin.c",
152+
"src/unix/fsevents.c",
153+
]
154+
defines += [
155+
"_DARWIN_USE_64_BIT_INODE=1",
156+
"_DARWIN_UNLIMITED_SELECT=1",
157+
]
158+
}
159+
if (is_linux) {
160+
defines += [ "_GNU_SOURCE" ]
161+
sources += [
162+
"src/unix/linux-core.c",
163+
"src/unix/linux-inotify.c",
164+
"src/unix/linux-syscalls.c",
165+
"src/unix/linux-syscalls.h",
166+
"src/unix/procfs-exepath.c",
167+
"src/unix/sysinfo-loadavg.c",
168+
"src/unix/sysinfo-memory.c",
169+
]
170+
libs += [
171+
"dl",
172+
"rt",
173+
]
174+
}
175+
if (is_mac) { # is_bsd
176+
sources += [
177+
"src/unix/bsd-ifaddrs.c",
178+
"src/unix/kqueue.c",
179+
]
180+
}
181+
if (is_component_build && is_win) {
182+
defines += [
183+
"BUILDING_UV_SHARED=1",
184+
]
185+
}
186+
}

0 commit comments

Comments
 (0)