Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: third_party/cld_2/cld_2.gyp

Issue 461633002: Refactor language detection logic to allow non-static CLD data sources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make some of the harness factory methods private Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/cld_2/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 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 # Note to maintainers: In the October 2014 release, there are some options for 5 # Note to maintainers: In the October 2014 release, there are some options for
6 # building: 6 # building:
7 # Pick one quadgram file (cld2_generated_quadchrome*.cc): 7 # Pick one quadgram file (cld2_generated_quadchrome*.cc):
8 # _16 = 160K entries, smallest size, lowest accuracy (set cld2_table_size=0) 8 # _16 = 160K entries, smallest size, lowest accuracy (set cld2_table_size=0)
9 # _2 = 256K entries, largest size, highest accuracy (set cld2_table_size=2) 9 # _2 = 256K entries, largest size, highest accuracy (set cld2_table_size=2)
10 # 10 #
11 # For the CJK bigram file (cld_generated_cjk_delta_bi*.cc), always use 11 # For the CJK bigram file (cld_generated_cjk_delta_bi*.cc), always use
12 # cld_generated_cjk_delta_bi_4.cc, as this is intended for use with Chromium. 12 # cld_generated_cjk_delta_bi_4.cc, as this is intended for use with Chromium.
13 # The _32 variant of the file is intended for applications that use the full 13 # The _32 variant of the file is intended for applications that use the full
14 # 175-language version of CLD2. 14 # 175-language version of CLD2.
15 15
16 { 16 {
17 'target_defaults': { 17 'target_defaults': {
18 'conditions': [ 18 'conditions': [
19 ['OS=="win"', { 19 ['OS=="win"', {
20 'msvs_disabled_warnings': [4267], 20 'msvs_disabled_warnings': [4267],
21 }], 21 }],
22 ], 22 ],
23 }, 23 },
24 'variables': { 24 'variables': {
25 # This variable controls which dependency is resolved by the pass-through
26 # target 'cld2_platform_impl', and allows the embedder to choose which
27 # kind of CLD2 support is required at build time:
28 #
29 # - If the value is 'static', then the cld2_platform_impl target will depend
30 # upon the cld2_static target
31 # - If the value is 'dynamic', then the cld2_platform_impl target will
32 # depend upon the cld2_dynamic target.
33 #
34 # High-level targets for Chromium unit tests hard-code a dependency upon
35 # cld2_static because doing so makes sense for use cases that aren't
36 # affected by the loading of language detection data; however, most other
37 # targets (e.g. the final executables and interactive UI tests) should be
38 # linked against whatever the embedder needs.
39 #
40 # Maintainers:
41 # This value may be reasonably tweaked in a 'conditions' block below on a
42 # per-platform basis. Don't forget to update the expectations in
43 # components/translate/content/browser/browser_cld_utils.cc as well, to
44 # match whatever is done here.
45 'cld2_platform_support%': 'static',
46
25 # These sources need to be included in both static and dynamic builds as 47 # These sources need to be included in both static and dynamic builds as
26 # well as the dynamic data tool. 48 # well as the dynamic data tool.
27 'cld2_core_sources': [ 49 'cld2_core_sources': [
28 'src/internal/cld2tablesummary.h', 50 'src/internal/cld2tablesummary.h',
29 'src/internal/cldutil.cc',
30 'src/internal/cldutil.h', 51 'src/internal/cldutil.h',
31 'src/internal/cldutil_shared.cc',
32 'src/internal/cldutil_shared.h', 52 'src/internal/cldutil_shared.h',
33 'src/internal/compact_lang_det.cc',
34 'src/internal/compact_lang_det_hint_code.cc',
35 'src/internal/compact_lang_det_hint_code.h', 53 'src/internal/compact_lang_det_hint_code.h',
36 'src/internal/compact_lang_det_impl.cc',
37 'src/internal/compact_lang_det_impl.h', 54 'src/internal/compact_lang_det_impl.h',
38 'src/internal/debug.h', 55 'src/internal/debug.h',
39 'src/internal/debug_empty.cc',
40 'src/internal/fixunicodevalue.cc',
41 'src/internal/fixunicodevalue.h', 56 'src/internal/fixunicodevalue.h',
42 'src/internal/generated_distinct_bi_0.cc',
43 'src/internal/generated_entities.cc',
44 'src/internal/generated_language.cc',
45 'src/internal/generated_language.h', 57 'src/internal/generated_language.h',
46 'src/internal/generated_ulscript.cc',
47 'src/internal/generated_ulscript.h', 58 'src/internal/generated_ulscript.h',
48 'src/internal/getonescriptspan.cc',
49 'src/internal/getonescriptspan.h', 59 'src/internal/getonescriptspan.h',
50 'src/internal/integral_types.h', 60 'src/internal/integral_types.h',
51 'src/internal/lang_script.cc',
52 'src/internal/lang_script.h', 61 'src/internal/lang_script.h',
53 'src/internal/langspan.h', 62 'src/internal/langspan.h',
54 'src/internal/offsetmap.cc',
55 'src/internal/offsetmap.h', 63 'src/internal/offsetmap.h',
56 'src/internal/port.h', 64 'src/internal/port.h',
57 'src/internal/scoreonescriptspan.cc',
58 'src/internal/scoreonescriptspan.h', 65 'src/internal/scoreonescriptspan.h',
59 'src/internal/stringpiece.h', 66 'src/internal/stringpiece.h',
60 'src/internal/tote.cc',
61 'src/internal/tote.h', 67 'src/internal/tote.h',
62 'src/internal/utf8prop_lettermarkscriptnum.h', 68 'src/internal/utf8prop_lettermarkscriptnum.h',
63 'src/internal/utf8repl_lettermarklower.h', 69 'src/internal/utf8repl_lettermarklower.h',
64 'src/internal/utf8scannot_lettermarkspecial.h', 70 'src/internal/utf8scannot_lettermarkspecial.h',
65 'src/internal/utf8statetable.cc',
66 'src/internal/utf8statetable.h', 71 'src/internal/utf8statetable.h',
67 'src/public/compact_lang_det.h', 72 'src/public/compact_lang_det.h',
68 'src/public/encodings.h', 73 'src/public/encodings.h',
69 ], 74 ],
75 'cld2_core_impl_sources': [
76 # Compilation is dependent upon flags.
77 'src/internal/cldutil.cc',
78 'src/internal/cldutil_shared.cc',
79 'src/internal/compact_lang_det.cc',
80 'src/internal/compact_lang_det_hint_code.cc',
81 'src/internal/compact_lang_det_impl.cc',
82 'src/internal/debug_empty.cc',
83 'src/internal/fixunicodevalue.cc',
84 'src/internal/generated_distinct_bi_0.cc',
85 'src/internal/generated_entities.cc',
86 'src/internal/generated_language.cc',
87 'src/internal/generated_ulscript.cc',
88 'src/internal/getonescriptspan.cc',
89 'src/internal/lang_script.cc',
90 'src/internal/offsetmap.cc',
91 'src/internal/scoreonescriptspan.cc',
92 'src/internal/tote.cc',
93 'src/internal/utf8statetable.cc',
94 ],
70 'cld2_dynamic_data_loader_sources': [ 95 'cld2_dynamic_data_loader_sources': [
71 'src/internal/cld2_dynamic_data.h', 96 'src/internal/cld2_dynamic_data.h',
72 'src/internal/cld2_dynamic_data.cc', 97 'src/internal/cld2_dynamic_data.cc',
73 'src/internal/cld2_dynamic_data_loader.h', 98 'src/internal/cld2_dynamic_data_loader.h',
74 'src/internal/cld2_dynamic_data_loader.cc', 99 'src/internal/cld2_dynamic_data_loader.cc',
75 ], 100 ],
76 'cld2_data_sources': [ 101 'cld2_data_sources': [
77 'src/internal/cld2_generated_cjk_compatible.cc', 102 'src/internal/cld2_generated_cjk_compatible.cc',
78 'src/internal/cld2_generated_deltaoctachrome.cc', 103 'src/internal/cld2_generated_deltaoctachrome.cc',
79 'src/internal/cld2_generated_distinctoctachrome.cc', 104 'src/internal/cld2_generated_distinctoctachrome.cc',
(...skipping 17 matching lines...) Expand all
97 # GN version: //third_party/cld_2 122 # GN version: //third_party/cld_2
98 'target_name': 'cld_2_dynamic_data_tool', 123 'target_name': 'cld_2_dynamic_data_tool',
99 'type': 'executable', 124 'type': 'executable',
100 'include_dirs': [ 125 'include_dirs': [
101 'src/internal', 126 'src/internal',
102 'src/public', 127 'src/public',
103 ], 128 ],
104 'sources': [ 129 'sources': [
105 # Note: sources list duplicated in GN build. 130 # Note: sources list duplicated in GN build.
106 '<@(cld2_core_sources)', 131 '<@(cld2_core_sources)',
132 '<@(cld2_core_impl_sources)',
107 '<@(cld2_data_sources)', 133 '<@(cld2_data_sources)',
108 '<@(cld2_dynamic_data_loader_sources)', 134 '<@(cld2_dynamic_data_loader_sources)',
109 'src/internal/cld2_dynamic_data_extractor.h', 135 'src/internal/cld2_dynamic_data_extractor.h',
110 'src/internal/cld2_dynamic_data_extractor.cc', 136 'src/internal/cld2_dynamic_data_extractor.cc',
111 'src/internal/cld2_dynamic_data_tool.cc', 137 'src/internal/cld2_dynamic_data_tool.cc',
112 ], 138 ],
139 'defines': ['CLD2_DYNAMIC_MODE'],
113 }, 140 },
114 141
115 { 142 {
116 # GN version: //third_party/cld_2 143 # GN version: //third_party/cld_2
144 # Depending upon cld_2 will provide core headers and function definitions,
145 # but no data. You must also depend on one of the following two targets:
146 # cld2_static - for a statically-linked data set built into the executable
147 # cld2_dynamic - for a dynamic data set loaded at runtime
117 'target_name': 'cld_2', 148 'target_name': 'cld_2',
118 'type': 'static_library', 149 'type': 'static_library',
119 'sources': [], 150 'sources': ['<@(cld2_core_sources)'],
120 'dependencies': [], 151 'dependencies': [],
121 'conditions': [ 152 },
122 ['cld2_data_source=="static"', 153
123 {'dependencies': ['cld2_static']}, 154 # As described above in the comments for cld2_platform_support, this is a
124 {'dependencies': ['cld2_dynamic']} 155 # passthrough target that allows high-level targets to depend upon the same
125 ], 156 # CLD support as desired by the embedder.
126 ], 157 {
158 'target_name': 'cld2_platform_impl',
159 'type': 'none',
160 'dependencies': ['cld2_<(cld2_platform_support)'],
127 }, 161 },
128 162
129 { 163 {
130 # GN version: //third_party/cld_2 164 # GN version: //third_party/cld_2
131 'target_name': 'cld2_static', 165 'target_name': 'cld2_static',
132 'type': 'static_library', 166 'type': 'static_library',
133 'include_dirs': [ 167 'include_dirs': [
134 'src/internal', 168 'src/internal',
135 'src/public', 169 'src/public',
136 ], 170 ],
137 'sources': [ 171 'sources': [
138 '<@(cld2_core_sources)', 172 '<@(cld2_core_sources)',
173 '<@(cld2_core_impl_sources)',
139 '<@(cld2_data_sources)', 174 '<@(cld2_data_sources)',
140 ], 175 ],
141 }, 176 },
142 177
143 { 178 {
144 # GN version: //third_party/cld_2 179 # GN version: //third_party/cld_2
145 'target_name': 'cld2_dynamic', 180 'target_name': 'cld2_dynamic',
146 'type': 'static_library', 181 'type': 'static_library',
147 'include_dirs': [ 182 'include_dirs': [
148 'src/internal', 183 'src/internal',
149 'src/public', 184 'src/public',
150 ], 185 ],
151 'sources': [ 186 'sources': [
152 '<@(cld2_core_sources)', 187 '<@(cld2_core_sources)',
188 '<@(cld2_core_impl_sources)',
153 '<@(cld2_dynamic_data_loader_sources)', 189 '<@(cld2_dynamic_data_loader_sources)',
154 ], 190 ],
155 'defines': ['CLD2_DYNAMIC_MODE'], 191 'defines': ['CLD2_DYNAMIC_MODE'],
156 'all_dependent_settings': {
157 'defines': ['CLD2_DYNAMIC_MODE'],
158 },
159 }, 192 },
160 ], 193 ],
161 } 194 }
OLDNEW
« no previous file with comments | « third_party/cld_2/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698