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 gypi_values = exec_script("//build/gypi_to_gn.py", | 7 gypi_values = exec_script("//build/gypi_to_gn.py", |
8 [ rebase_path("cld_2.gyp") ], | 8 [ rebase_path("cld_2.gyp") ], |
9 "scope", | 9 "scope", |
10 [ "cld_2.gyp" ]) | 10 [ "cld_2.gyp" ]) |
(...skipping 15 matching lines...) Expand all Loading... |
26 # | 26 # |
27 # Maintainers: | 27 # Maintainers: |
28 # This value may be reasonably tweaked on a per-platform basis. | 28 # This value may be reasonably tweaked on a per-platform basis. |
29 # Don't forget to update this file as well to match: | 29 # Don't forget to update this file as well to match: |
30 # components/translate/content/browser/browser_cld_utils.cc | 30 # components/translate/content/browser/browser_cld_utils.cc |
31 # components/translate/content/renderer/renderer_cld_utils.cc | 31 # components/translate/content/renderer/renderer_cld_utils.cc |
32 cld2_platform_support = "static" | 32 cld2_platform_support = "static" |
33 | 33 |
34 cld2_table_size = 2 | 34 cld2_table_size = 2 |
35 | 35 |
| 36 config("cld2_data_warnings") { |
| 37 visibility = [ ":*" ] |
| 38 if (is_clang) { |
| 39 # The generated files don't have braces around subobject initializers. |
| 40 cflags = [ "-Wno-missing-braces" ] |
| 41 } |
| 42 } |
| 43 |
36 source_set("cld2_data") { | 44 source_set("cld2_data") { |
37 sources = gypi_values.cld2_data_sources | 45 sources = gypi_values.cld2_data_sources |
38 if (cld2_table_size == 0) { | 46 if (cld2_table_size == 0) { |
39 sources += gypi_values.cld2_data_smallest_sources | 47 sources += gypi_values.cld2_data_smallest_sources |
40 } else if (cld2_table_size == 2) { | 48 } else if (cld2_table_size == 2) { |
41 sources += gypi_values.cld2_data_largest_sources | 49 sources += gypi_values.cld2_data_largest_sources |
42 } | 50 } |
43 | 51 |
44 include_dirs = [ | 52 include_dirs = [ |
45 "src/internal", | 53 "src/internal", |
46 "src/public", | 54 "src/public", |
47 ] | 55 ] |
48 | 56 |
49 config("cld2_data_warnings") { | |
50 if (is_clang) { | |
51 # The generated files don't have braces around subobject initializers. | |
52 cflags = [ "-Wno-missing-braces" ] | |
53 } | |
54 } | |
55 configs -= [ "//build/config/compiler:chromium_code" ] | 57 configs -= [ "//build/config/compiler:chromium_code" ] |
56 configs += [ "//build/config/compiler:no_chromium_code" ] | 58 configs += [ |
57 configs += [ ":cld2_data_warnings" ] | 59 "//build/config/compiler:no_chromium_code", |
| 60 |
| 61 # Must be after no_chromium_code for warning flags to be ordered correctly. |
| 62 ":cld2_data_warnings", |
| 63 ] |
58 } | 64 } |
59 | 65 |
60 # As in the corresponding gyp file, this just builds the core interfaces for | 66 # As in the corresponding gyp file, this just builds the core interfaces for |
61 # CLD2. You must still declare a dependency on a specific data set, either | 67 # CLD2. You must still declare a dependency on a specific data set, either |
62 # cld2_dynamic or cld2_static. | 68 # cld2_dynamic or cld2_static. |
63 source_set("cld_2") { | 69 source_set("cld_2") { |
64 sources = gypi_values.cld2_core_sources | 70 sources = gypi_values.cld2_core_sources |
65 include_dirs = [ | 71 include_dirs = [ |
66 "src/internal", | 72 "src/internal", |
67 "src/public", | 73 "src/public", |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 "//build/config/sanitizers:deps", | 154 "//build/config/sanitizers:deps", |
149 ] | 155 ] |
150 | 156 |
151 configs -= [ "//build/config/compiler:chromium_code" ] | 157 configs -= [ "//build/config/compiler:chromium_code" ] |
152 configs += [ | 158 configs += [ |
153 ":cld2_dynamic_mode_config", | 159 ":cld2_dynamic_mode_config", |
154 "//build/config/compiler:no_chromium_code", | 160 "//build/config/compiler:no_chromium_code", |
155 ] | 161 ] |
156 } | 162 } |
157 } | 163 } |
OLD | NEW |