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

Commit

Permalink
fix: use zlib from electron_node (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
adill authored and MarshallOfSound committed Oct 25, 2018
1 parent 61023b9 commit ec46481
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 4 deletions.
7 changes: 3 additions & 4 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ component("node_lib") {
"deps/cares",
"deps/http_parser",
"deps/nghttp2",
"//third_party/zlib",
"deps/zlib",
"//v8:v8_libplatform",
]
public_deps = [
Expand Down Expand Up @@ -278,9 +278,8 @@ foreach(header_group, node_files.headers) {

copy("zlib_headers") {
sources = [
"//third_party/zlib/names.h",
"//third_party/zlib/zconf.h",
"//third_party/zlib/zlib.h",
"deps/zlib/zconf.h",
"deps/zlib/zlib.h",
]
outputs = [
"$node_headers_dir/include/node/{{source_file_part}}",
Expand Down
58 changes: 58 additions & 0 deletions deps/zlib/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
config("includes") {
include_dirs = [ "." ]
}

config("ignored_warnings") {
if (is_win) {
cflags = [
"/wd4131", # old-style declarator
"/wd4127", # conditional expression is constant
"/wd4244", # possible loss of data on type conversion
"/wd4996", # deprecated 'open'
]
} else {
cflags = [
"-Wno-implicit-function-declaration",
"-Wno-shift-negative-value",
]
}
}

source_set("zlib") {
sources = [
"adler32.c",
"compress.c",
"crc32.c",
"crc32.h",
"deflate.c",
"deflate.h",
"gzclose.c",
"gzguts.h",
"gzlib.c",
"gzread.c",
"gzwrite.c",
"infback.c",
"inffast.c",
"inffast.h",
"inffixed.h",
"inflate.c",
"inflate.h",
"inftrees.c",
"inftrees.h",
"trees.c",
"trees.h",
"uncompr.c",
"zconf.h",
"zlib.h",
"zutil.c",
"zutil.h",
]

if (is_win) {
defines = [ "ZLIB_DLL" ]
}

configs += [ ":ignored_warnings" ]

public_configs = [ ":includes" ]
}

0 comments on commit ec46481

Please sign in to comment.