summaryrefslogtreecommitdiffstats
path: root/third_party/brotli/BUILD.gn
blob: 2975f036df401585fe627b329471ad62c7bc65e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Copyright 2014 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.

source_set("brotli") {
  sources = [
    "dec/bit_reader.c",
    "dec/bit_reader.h",
    "dec/context.h",
    "dec/decode.c",
    "dec/decode.h",
    "dec/dictionary.h",
    "dec/huffman.c",
    "dec/huffman.h",
    "dec/prefix.h",
    "dec/safe_malloc.c",
    "dec/safe_malloc.h",
    "dec/state.c",
    "dec/state.h",
    "dec/streams.c",
    "dec/streams.h",
    "dec/transform.h",
    "dec/types.h",
  ]

  config("brotli_warnings") {
    if (is_clang) {
      # IncrementalCopyFastPath in decode.c can be unused.
      # (The file looks very different upstream, this is probably no longer
      # needed after rolling brotli the next time.)
      cflags = [ "-Wno-unused-function" ]
    }
  }
  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [ "//build/config/compiler:no_chromium_code" ]
  configs += [ ":brotli_warnings" ]

  # Since we are never debug brotli, freeze the optimizations to -O2.
  if (is_debug) {
    configs -= [ "//build/config/compiler:no_optimize" ]
  } else {
    configs -= [ "//build/config/compiler:optimize" ]
  }
  configs += [ "//build/config/compiler:optimize_max" ]

  include_dirs = [ "dec" ]
}