OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 if (is_win) { | 5 if (is_win) { |
6 import("//build/config/win/visual_studio_version.gni") | 6 import("//build/config/win/visual_studio_version.gni") |
7 } | 7 } |
8 | 8 |
9 static_library("brotli") { | 9 config("includes") { |
10 include_dirs = [ "include" ] | |
11 } | |
12 | |
13 static_library("common") { | |
14 sources = [ | |
15 "common/constants.h", | |
16 "common/dictionary.c", | |
17 "common/dictionary.h", | |
18 "common/version.h", | |
19 ] | |
20 public_configs = [ ":includes" ] | |
Kunihiko Sakamoto
2016/12/05 02:27:00
Since you're using #include "third_party/brotli/..
eustas
2016/12/05 14:15:01
decode.h and encode.h include <brotli/port.h> and
| |
21 } | |
22 | |
23 static_library("dec") { | |
10 sources = [ | 24 sources = [ |
11 "dec/bit_reader.c", | 25 "dec/bit_reader.c", |
12 "dec/bit_reader.h", | 26 "dec/bit_reader.h", |
13 "dec/context.h", | 27 "dec/context.h", |
14 "dec/decode.c", | 28 "dec/decode.c", |
15 "dec/decode.h", | |
16 "dec/dictionary.c", | |
17 "dec/dictionary.h", | |
18 "dec/huffman.c", | 29 "dec/huffman.c", |
19 "dec/huffman.h", | 30 "dec/huffman.h", |
20 "dec/port.h", | 31 "dec/port.h", |
21 "dec/prefix.h", | 32 "dec/prefix.h", |
22 "dec/state.c", | 33 "dec/state.c", |
23 "dec/state.h", | 34 "dec/state.h", |
24 "dec/transform.h", | 35 "dec/transform.h", |
25 "dec/types.h", | 36 ] |
37 public_configs = [ ":includes" ] | |
Kunihiko Sakamoto
2016/12/05 02:27:00
Same here
eustas
2016/12/05 14:15:01
Acknowledged.
| |
38 | |
39 deps = [ | |
40 ":common", | |
26 ] | 41 ] |
27 | 42 |
28 configs -= [ "//build/config/compiler:chromium_code" ] | 43 configs -= [ "//build/config/compiler:chromium_code" ] |
29 configs += [ "//build/config/compiler:no_chromium_code" ] | 44 configs += [ "//build/config/compiler:no_chromium_code" ] |
30 | 45 |
31 # Since we are never debug brotli, freeze the optimizations to -O2. | 46 # Since we are never debug brotli, freeze the optimizations to -O2. |
32 configs -= [ "//build/config/compiler:default_optimization" ] | 47 configs -= [ "//build/config/compiler:default_optimization" ] |
33 configs += [ "//build/config/compiler:optimize_max" ] | 48 configs += [ "//build/config/compiler:optimize_max" ] |
34 | |
35 include_dirs = [ "dec" ] | |
36 } | 49 } |
37 | 50 |
38 if (current_toolchain == host_toolchain) { | 51 if (current_toolchain == host_toolchain) { |
39 executable("bro") { | 52 executable("bro") { |
40 sources = [ | 53 sources = [ |
41 "enc/backward_references.cc", | 54 "common/constants.h", |
55 "enc/backward_references.c", | |
42 "enc/backward_references.h", | 56 "enc/backward_references.h", |
57 "enc/backward_references_inc.h", | |
58 "enc/bit_cost.c", | |
43 "enc/bit_cost.h", | 59 "enc/bit_cost.h", |
44 "enc/block_splitter.cc", | 60 "enc/bit_cost_inc.h", |
61 "enc/block_encoder_inc.h", | |
62 "enc/block_splitter.c", | |
45 "enc/block_splitter.h", | 63 "enc/block_splitter.h", |
46 "enc/brotli_bit_stream.cc", | 64 "enc/block_splitter_inc.h", |
65 "enc/brotli_bit_stream.c", | |
47 "enc/brotli_bit_stream.h", | 66 "enc/brotli_bit_stream.h", |
67 "enc/cluster.c", | |
48 "enc/cluster.h", | 68 "enc/cluster.h", |
69 "enc/cluster_inc.h", | |
49 "enc/command.h", | 70 "enc/command.h", |
50 "enc/compress_fragment.cc", | 71 "enc/compress_fragment.c", |
51 "enc/compress_fragment.h", | 72 "enc/compress_fragment.h", |
52 "enc/compress_fragment_two_pass.cc", | 73 "enc/compress_fragment_two_pass.c", |
53 "enc/compress_fragment_two_pass.h", | 74 "enc/compress_fragment_two_pass.h", |
54 "enc/compressor.h", | |
55 "enc/context.h", | 75 "enc/context.h", |
56 "enc/dictionary_hash.h", | 76 "enc/dictionary_hash.h", |
57 "enc/encode.cc", | 77 "enc/encode.c", |
58 "enc/encode.h", | 78 "enc/entropy_encode.c", |
59 "enc/encode_parallel.cc", | |
60 "enc/encode_parallel.h", | |
61 "enc/entropy_encode.cc", | |
62 "enc/entropy_encode.h", | 79 "enc/entropy_encode.h", |
63 "enc/entropy_encode_static.h", | 80 "enc/entropy_encode_static.h", |
64 "enc/fast_log.h", | 81 "enc/fast_log.h", |
65 "enc/find_match_length.h", | 82 "enc/find_match_length.h", |
66 "enc/hash.h ", | 83 "enc/hash.h", |
67 "enc/histogram.cc", | 84 "enc/hash_forgetful_chain_inc.h", |
85 "enc/hash_longest_match_inc.h", | |
86 "enc/hash_longest_match_quickly_inc.h", | |
87 "enc/histogram.c", | |
68 "enc/histogram.h", | 88 "enc/histogram.h", |
69 "enc/literal_cost.cc", | 89 "enc/histogram_inc.h", |
90 "enc/literal_cost.c", | |
70 "enc/literal_cost.h", | 91 "enc/literal_cost.h", |
71 "enc/metablock.cc", | 92 "enc/memory.c", |
93 "enc/memory.h", | |
94 "enc/metablock.c", | |
72 "enc/metablock.h", | 95 "enc/metablock.h", |
73 "enc/port.h ", | 96 "enc/metablock_inc.h", |
97 "enc/port.h", | |
74 "enc/prefix.h", | 98 "enc/prefix.h", |
99 "enc/quality.h", | |
75 "enc/ringbuffer.h", | 100 "enc/ringbuffer.h", |
76 "enc/static_dict.cc", | 101 "enc/static_dict.c", |
77 "enc/static_dict.h", | 102 "enc/static_dict.h", |
78 "enc/static_dict_lut.h", | 103 "enc/static_dict_lut.h", |
79 "enc/streams.cc", | 104 "enc/utf8_util.c", |
80 "enc/streams.h", | |
81 "enc/transform.h", | |
82 "enc/types.h", | |
83 "enc/utf8_util.cc", | |
84 "enc/utf8_util.h", | 105 "enc/utf8_util.h", |
85 "enc/write_bits.h", | 106 "enc/write_bits.h", |
86 "tools/bro.cc", | 107 "tools/bro.c", |
87 ] | 108 ] |
109 public_configs = [ ":includes" ] | |
Kunihiko Sakamoto
2016/12/05 02:27:00
Same here
eustas
2016/12/05 14:15:01
Acknowledged.
| |
110 | |
88 deps = [ | 111 deps = [ |
89 ":brotli", | 112 ":common", |
113 ":dec", | |
90 "//build/config/sanitizers:deps", | 114 "//build/config/sanitizers:deps", |
91 "//build/win:default_exe_manifest", | 115 "//build/win:default_exe_manifest", |
92 ] | 116 ] |
93 | 117 |
94 if (is_win && visual_studio_version == "2015") { | 118 if (is_win && visual_studio_version == "2015") { |
95 # Disabling "result of 32-bit shift implicitly converted to 64 bits", | 119 # Disabling "result of 32-bit shift implicitly converted to 64 bits", |
96 # caused by code like: foo |= (1 << i); // warning 4334 | 120 # caused by code like: foo |= (1 << i); // warning 4334 |
97 cflags = [ "/wd4334" ] | 121 cflags = [ "/wd4334" ] |
98 } | 122 } |
99 | 123 |
100 # Always build release since this is a build tool. | 124 # Always build release since this is a build tool. |
101 if (is_debug) { | 125 if (is_debug) { |
102 configs -= [ "//build/config:debug" ] | 126 configs -= [ "//build/config:debug" ] |
103 configs += [ "//build/config:release" ] | 127 configs += [ "//build/config:release" ] |
104 } | 128 } |
105 } | 129 } |
106 } | 130 } |
OLD | NEW |