Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 } else if (cld2_table_size == 2) { | 40 } else if (cld2_table_size == 2) { |
| 41 sources += gypi_values.cld2_data_largest_sources | 41 sources += gypi_values.cld2_data_largest_sources |
| 42 } | 42 } |
| 43 | 43 |
| 44 include_dirs = [ | 44 include_dirs = [ |
| 45 "src/internal", | 45 "src/internal", |
| 46 "src/public", | 46 "src/public", |
| 47 ] | 47 ] |
| 48 | 48 |
| 49 configs -= [ "//build/config/compiler:chromium_code" ] | 49 configs -= [ "//build/config/compiler:chromium_code" ] |
| 50 configs += [ "//build/config/compiler:no_chromium_code" ] | 50 configs += [ |
| 51 | 51 "//build/config/compiler:no_chromium_code", |
| 52 if (is_win) { | 52 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 53 cflags = [ "/wd4267" ] # size_t -> int conversion. | 53 "//build/config/compiler:no_size_t_to_int_warning", |
|
Dirk Pranke
2015/02/18 21:29:29
and again ... I'll stop mentioning this now, but i
| |
| 54 } | 54 ] |
| 55 } | 55 } |
| 56 | 56 |
| 57 # As in the corresponding gyp file, this just builds the core interfaces for | 57 # As in the corresponding gyp file, this just builds the core interfaces for |
| 58 # CLD2. You must still declare a dependency on a specific data set, either | 58 # CLD2. You must still declare a dependency on a specific data set, either |
| 59 # cld2_dynamic or cld2_static. | 59 # cld2_dynamic or cld2_static. |
| 60 source_set("cld_2") { | 60 source_set("cld_2") { |
| 61 sources = gypi_values.cld2_core_sources | 61 sources = gypi_values.cld2_core_sources |
| 62 include_dirs = [ | 62 include_dirs = [ |
| 63 "src/internal", | 63 "src/internal", |
| 64 "src/public", | 64 "src/public", |
| 65 ] | 65 ] |
| 66 | 66 |
| 67 configs -= [ "//build/config/compiler:chromium_code" ] | 67 configs -= [ "//build/config/compiler:chromium_code" ] |
| 68 configs += [ "//build/config/compiler:no_chromium_code" ] | 68 configs += [ |
| 69 | 69 "//build/config/compiler:no_chromium_code", |
| 70 if (is_win) { | 70 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 71 cflags = [ "/wd4267" ] # size_t -> int conversion. | 71 "//build/config/compiler:no_size_t_to_int_warning", |
| 72 } | 72 ] |
| 73 } | 73 } |
| 74 | 74 |
| 75 source_set("cld2_platform_impl") { | 75 source_set("cld2_platform_impl") { |
| 76 deps = [] | 76 deps = [] |
| 77 if (cld2_platform_support == "static") { | 77 if (cld2_platform_support == "static") { |
| 78 deps += [ ":cld2_static" ] | 78 deps += [ ":cld2_static" ] |
| 79 } else if (cld2_platform_support == "dynamic") { | 79 } else if (cld2_platform_support == "dynamic") { |
| 80 deps += [ ":cld2_dynamic" ] | 80 deps += [ ":cld2_dynamic" ] |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 | 83 |
| 84 static_library("cld2_static") { | 84 static_library("cld2_static") { |
| 85 sources = gypi_values.cld2_core_impl_sources | 85 sources = gypi_values.cld2_core_impl_sources |
| 86 include_dirs = [ | 86 include_dirs = [ |
| 87 "src/internal", | 87 "src/internal", |
| 88 "src/public", | 88 "src/public", |
| 89 ] | 89 ] |
| 90 | 90 |
| 91 deps = [ | 91 deps = [ |
| 92 ":cld_2", | 92 ":cld_2", |
| 93 ":cld2_data", | 93 ":cld2_data", |
| 94 ] | 94 ] |
| 95 configs -= [ "//build/config/compiler:chromium_code" ] | 95 configs -= [ "//build/config/compiler:chromium_code" ] |
| 96 configs += [ "//build/config/compiler:no_chromium_code" ] | 96 configs += [ |
| 97 | 97 "//build/config/compiler:no_chromium_code", |
| 98 if (is_win) { | 98 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 99 cflags = [ "/wd4267" ] # size_t -> int conversion. | 99 "//build/config/compiler:no_size_t_to_int_warning", |
| 100 } | 100 ] |
| 101 } | 101 } |
| 102 | 102 |
| 103 config("cld2_dynamic_mode_config") { | 103 config("cld2_dynamic_mode_config") { |
| 104 defines = [ "CLD2_DYNAMIC_MODE" ] | 104 defines = [ "CLD2_DYNAMIC_MODE" ] |
| 105 } | 105 } |
| 106 | 106 |
| 107 static_library("cld2_dynamic") { | 107 static_library("cld2_dynamic") { |
| 108 sources = gypi_values.cld2_core_sources + gypi_values.cld2_core_impl_sources + | 108 sources = gypi_values.cld2_core_sources + gypi_values.cld2_core_impl_sources + |
| 109 gypi_values.cld2_dynamic_data_loader_sources | 109 gypi_values.cld2_dynamic_data_loader_sources |
| 110 include_dirs = [ | 110 include_dirs = [ |
| 111 "src/internal", | 111 "src/internal", |
| 112 "src/public", | 112 "src/public", |
| 113 ] | 113 ] |
| 114 | 114 |
| 115 configs -= [ "//build/config/compiler:chromium_code" ] | 115 configs -= [ "//build/config/compiler:chromium_code" ] |
| 116 configs += [ | 116 configs += [ |
| 117 ":cld2_dynamic_mode_config", | |
| 117 "//build/config/compiler:no_chromium_code", | 118 "//build/config/compiler:no_chromium_code", |
| 118 ":cld2_dynamic_mode_config", | 119 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 120 "//build/config/compiler:no_size_t_to_int_warning", | |
| 119 ] | 121 ] |
| 120 | |
| 121 if (is_win) { | |
| 122 cflags = [ "/wd4267" ] # size_t -> int conversion. | |
| 123 } | |
| 124 } | 122 } |
| 125 | 123 |
| 126 # Does not build on Windows. | 124 # Does not build on Windows. |
| 127 if (!is_win) { | 125 if (!is_win) { |
| 128 executable("cld_2_dynamic_data_tool") { | 126 executable("cld_2_dynamic_data_tool") { |
| 129 sources = [ | 127 sources = [ |
| 130 "src/internal/cld2_dynamic_data_extractor.h", | 128 "src/internal/cld2_dynamic_data_extractor.h", |
| 131 "src/internal/cld2_dynamic_data_extractor.cc", | 129 "src/internal/cld2_dynamic_data_extractor.cc", |
| 132 "src/internal/cld2_dynamic_data_tool.cc", | 130 "src/internal/cld2_dynamic_data_tool.cc", |
| 133 ] | 131 ] |
| 134 | 132 |
| 135 include_dirs = [ | 133 include_dirs = [ |
| 136 "src/internal", | 134 "src/internal", |
| 137 "src/public", | 135 "src/public", |
| 138 ] | 136 ] |
| 139 | 137 |
| 140 deps = [ | 138 deps = [ |
| 141 ":cld2_data", | 139 ":cld2_data", |
| 142 ":cld2_dynamic", | 140 ":cld2_dynamic", |
| 143 ] | 141 ] |
| 144 | 142 |
| 145 configs -= [ "//build/config/compiler:chromium_code" ] | 143 configs -= [ "//build/config/compiler:chromium_code" ] |
| 146 configs += [ | 144 configs += [ |
| 145 ":cld2_dynamic_mode_config", | |
| 147 "//build/config/compiler:no_chromium_code", | 146 "//build/config/compiler:no_chromium_code", |
| 148 ":cld2_dynamic_mode_config", | 147 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 148 "//build/config/compiler:no_size_t_to_int_warning", | |
| 149 ] | 149 ] |
| 150 | |
| 151 if (is_win) { | |
| 152 cflags = [ "/wd4267" ] # size_t -> int conversion. | |
| 153 } | |
| 154 } | 150 } |
| 155 } | 151 } |
| OLD | NEW |