Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #48 from electron/build-gn
Browse files Browse the repository at this point in the history
gn build files
  • Loading branch information
John Kleinschmidt authored Aug 14, 2018
2 parents bf0e061 + e50ae50 commit ed9e26b
Show file tree
Hide file tree
Showing 9 changed files with 1,122 additions and 2 deletions.
610 changes: 610 additions & 0 deletions BUILD.gn

Large diffs are not rendered by default.

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

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",
]
}
176 changes: 176 additions & 0 deletions deps/uv/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
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-implicit-function-declaration",
"-Wno-string-conversion",
]

libs = []

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

if (is_win) {
defines += [
"_WIN32_WINNT=0x0600",
"_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/timer.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/timer.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",
]
}
}
2 changes: 1 addition & 1 deletion src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# define NODE_EXTERN __declspec(dllimport)
# endif
#else
# define NODE_EXTERN /* nothing */
# define NODE_EXTERN __attribute__((visibility("default")))
#endif

#define NODE_MAKE_VERSION(major, minor, patch) \
Expand Down
Loading

0 comments on commit ed9e26b

Please sign in to comment.