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 import("//build/config/features.gni") | 5 import("//build/config/features.gni") |
6 | 6 |
| 7 declare_args() { |
| 8 if (is_android || is_ios) { |
| 9 cld2_table_size = 0 # Small, accurate tables |
| 10 } else { |
| 11 cld2_table_size = 2 # Larger, more accurate tables |
| 12 } |
| 13 } |
| 14 |
7 gypi_values = exec_script("//build/gypi_to_gn.py", | 15 gypi_values = exec_script("//build/gypi_to_gn.py", |
8 [ rebase_path("cld_2.gyp") ], | 16 [ rebase_path("cld_2.gyp") ], |
9 "scope", | 17 "scope", |
10 [ "cld_2.gyp" ]) | 18 [ "cld_2.gyp" ]) |
11 | 19 |
12 # This variable controls which dependency is resolved by the pass-through | 20 # This variable controls which dependency is resolved by the pass-through |
13 # target 'cld2_platform_impl', and allows the embedder to choose which | 21 # target 'cld2_platform_impl', and allows the embedder to choose which |
14 # kind of CLD2 support is required at build time: | 22 # kind of CLD2 support is required at build time: |
15 # | 23 # |
16 # - If the value is 'static', then the cld2_platform_impl target will depend | 24 # - If the value is 'static', then the cld2_platform_impl target will depend |
17 # upon the cld2_static target | 25 # upon the cld2_static target |
18 # - If the value is 'dynamic', then the cld2_platform_impl target will | 26 # - If the value is 'dynamic', then the cld2_platform_impl target will |
19 # depend upon the cld2_dynamic target. | 27 # depend upon the cld2_dynamic target. |
20 # | 28 # |
21 # High-level targets for Chromium unit tests hard-code a dependency upon | 29 # High-level targets for Chromium unit tests hard-code a dependency upon |
22 # cld2_static because doing so makes sense for use cases that aren't | 30 # cld2_static because doing so makes sense for use cases that aren't |
23 # affected by the loading of language detection data; however, most other | 31 # affected by the loading of language detection data; however, most other |
24 # targets (e.g. the final executables and interactive UI tests) should be | 32 # targets (e.g. the final executables and interactive UI tests) should be |
25 # linked against whatever the embedder needs. | 33 # linked against whatever the embedder needs. |
26 # | 34 # |
27 # Maintainers: | 35 # Maintainers: |
28 # This value may be reasonably tweaked on a per-platform basis. | 36 # This value may be reasonably tweaked on a per-platform basis. |
29 # Don't forget to update this file as well to match: | 37 # Don't forget to update this file as well to match: |
30 # components/translate/content/browser/browser_cld_utils.cc | 38 # components/translate/content/browser/browser_cld_utils.cc |
31 # components/translate/content/renderer/renderer_cld_utils.cc | 39 # components/translate/content/renderer/renderer_cld_utils.cc |
32 cld2_platform_support = "static" | 40 cld2_platform_support = "static" |
33 | 41 |
34 cld2_table_size = 2 | |
35 | |
36 config("cld2_data_warnings") { | 42 config("cld2_data_warnings") { |
37 visibility = [ ":*" ] | 43 visibility = [ ":*" ] |
38 if (is_clang) { | 44 if (is_clang) { |
39 # The generated files don't have braces around subobject initializers. | 45 # The generated files don't have braces around subobject initializers. |
40 cflags = [ "-Wno-missing-braces" ] | 46 cflags = [ "-Wno-missing-braces" ] |
41 } | 47 } |
42 } | 48 } |
43 | 49 |
44 source_set("cld2_data") { | 50 source_set("cld2_data") { |
45 sources = gypi_values.cld2_data_sources | 51 sources = gypi_values.cld2_data_sources |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 "//build/config/sanitizers:deps", | 160 "//build/config/sanitizers:deps", |
155 ] | 161 ] |
156 | 162 |
157 configs -= [ "//build/config/compiler:chromium_code" ] | 163 configs -= [ "//build/config/compiler:chromium_code" ] |
158 configs += [ | 164 configs += [ |
159 ":cld2_dynamic_mode_config", | 165 ":cld2_dynamic_mode_config", |
160 "//build/config/compiler:no_chromium_code", | 166 "//build/config/compiler:no_chromium_code", |
161 ] | 167 ] |
162 } | 168 } |
163 } | 169 } |
OLD | NEW |