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

Commit d5db59c

Browse files
adilldeepak1556
authored andcommitted
fix: use zlib from electron_node (#75)
1 parent e3d3abe commit d5db59c

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

BUILD.gn

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ component("node_lib") {
131131
"deps/cares",
132132
"deps/http_parser",
133133
"deps/nghttp2",
134-
"//third_party/zlib",
134+
"deps/zlib",
135135
"//v8:v8_libplatform",
136136
]
137137
public_deps = [
@@ -278,9 +278,8 @@ foreach(header_group, node_files.headers) {
278278

279279
copy("zlib_headers") {
280280
sources = [
281-
"//third_party/zlib/names.h",
282-
"//third_party/zlib/zconf.h",
283-
"//third_party/zlib/zlib.h",
281+
"deps/zlib/zconf.h",
282+
"deps/zlib/zlib.h",
284283
]
285284
outputs = [
286285
"$node_headers_dir/include/node/{{source_file_part}}",

deps/zlib/BUILD.gn

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
config("includes") {
2+
include_dirs = [ "." ]
3+
}
4+
5+
config("ignored_warnings") {
6+
if (is_win) {
7+
cflags = [
8+
"/wd4131", # old-style declarator
9+
"/wd4127", # conditional expression is constant
10+
"/wd4244", # possible loss of data on type conversion
11+
"/wd4996", # deprecated 'open'
12+
]
13+
} else {
14+
cflags = [
15+
"-Wno-implicit-function-declaration",
16+
"-Wno-shift-negative-value",
17+
]
18+
}
19+
}
20+
21+
source_set("zlib") {
22+
sources = [
23+
"adler32.c",
24+
"compress.c",
25+
"crc32.c",
26+
"crc32.h",
27+
"deflate.c",
28+
"deflate.h",
29+
"gzclose.c",
30+
"gzguts.h",
31+
"gzlib.c",
32+
"gzread.c",
33+
"gzwrite.c",
34+
"infback.c",
35+
"inffast.c",
36+
"inffast.h",
37+
"inffixed.h",
38+
"inflate.c",
39+
"inflate.h",
40+
"inftrees.c",
41+
"inftrees.h",
42+
"trees.c",
43+
"trees.h",
44+
"uncompr.c",
45+
"zconf.h",
46+
"zlib.h",
47+
"zutil.c",
48+
"zutil.h",
49+
]
50+
51+
if (is_win) {
52+
defines = [ "ZLIB_DLL" ]
53+
}
54+
55+
configs += [ ":ignored_warnings" ]
56+
57+
public_configs = [ ":includes" ]
58+
}

0 commit comments

Comments
 (0)