diff --git a/BUILD.gn b/BUILD.gn index b2bd33e57a0..7a93118a499 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -131,7 +131,7 @@ component("node_lib") { "deps/cares", "deps/http_parser", "deps/nghttp2", - "//third_party/zlib", + "deps/zlib", "//v8:v8_libplatform", ] public_deps = [ @@ -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}}", diff --git a/deps/zlib/BUILD.gn b/deps/zlib/BUILD.gn new file mode 100644 index 00000000000..f13b471d171 --- /dev/null +++ b/deps/zlib/BUILD.gn @@ -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" ] +}