# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

config("zlib_config") {
  include_dirs = [ "src" ]
}

config("zlib_internal_config") {
  defines = [ "ZLIB_IMPLEMENTATION" ]
  cflags = [ "-w" ]  # Disable all warnings.
}

static_library("zlib") {
  # Don't stomp on "libzlib"
  output_name = "chrome_zlib"

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

  defines = []
  deps = []

  include_dirs = [ "." ]
  configs += [ ":zlib_internal_config" ]

  public_configs = [ ":zlib_config" ]

  allow_circular_includes_from = deps
}