| 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 # May need to make this a build arg, keep the name for now to match gyp | 7 # May need to make this a build arg, keep the name for now to match gyp |
| 8 cld2_table_size = 2 | 8 cld2_table_size = 2 |
| 9 | 9 |
| 10 core_files = [ | 10 core_files = [ |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 ] | 81 ] |
| 82 | 82 |
| 83 configs -= [ "//build/config/compiler:chromium_code" ] | 83 configs -= [ "//build/config/compiler:chromium_code" ] |
| 84 configs += [ "//build/config/compiler:no_chromium_code" ] | 84 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 85 | 85 |
| 86 if (is_win) { | 86 if (is_win) { |
| 87 cflags = [ "/wd4267" ] # size_t -> int conversion. | 87 cflags = [ "/wd4267" ] # size_t -> int conversion. |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 | 90 |
| 91 static_library("cld2_static") { | 91 # As in the corresponding gyp file, this just builds the core interfaces for |
| 92 # CLD2. You must still declare a dependency on a specific data set, either |
| 93 # cld2_dynamic or cld2_static. |
| 94 static_library("cld_2") { |
| 92 sources = core_files | 95 sources = core_files |
| 93 include_dirs = [ | 96 include_dirs = [ |
| 94 "src/internal", | 97 "src/internal", |
| 95 "src/public", | 98 "src/public", |
| 96 ] | 99 ] |
| 97 | 100 |
| 98 deps = [ ":cld2_data" ] | |
| 99 configs -= [ "//build/config/compiler:chromium_code" ] | 101 configs -= [ "//build/config/compiler:chromium_code" ] |
| 100 configs += [ "//build/config/compiler:no_chromium_code" ] | 102 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 101 | 103 |
| 102 if (is_win) { | 104 if (is_win) { |
| 103 cflags = [ "/wd4267" ] # size_t -> int conversion. | 105 cflags = [ "/wd4267" ] # size_t -> int conversion. |
| 104 } | 106 } |
| 105 } | 107 } |
| 106 | 108 |
| 107 # Meta-target for convenience; dependents don't need to know if this if CLD2 | 109 static_library("cld2_static") { |
| 108 # is in dynamic or static configuration. | 110 sources = core_files |
| 109 group("cld_2") { | 111 include_dirs = [ |
| 110 if (cld2_data_source == "static") { | 112 "src/internal", |
| 111 deps = [ ":cld2_static" ] | 113 "src/public", |
| 112 } else { | 114 ] |
| 113 deps = [ ":cld2_dynamic" ] | 115 |
| 116 deps = [ ":cld2_data" ] |
| 117 configs -= [ "//build/config/compiler:chromium_code" ] |
| 118 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 119 |
| 120 if (is_win) { |
| 121 cflags = [ "/wd4267" ] # size_t -> int conversion. |
| 114 } | 122 } |
| 115 } | 123 } |
| 116 | 124 |
| 117 config("cld2_dynamic_mode_config") { | 125 config("cld2_dynamic_mode_config") { |
| 118 defines = [ "CLD2_DYNAMIC_MODE" ] | 126 defines = [ "CLD2_DYNAMIC_MODE" ] |
| 119 } | 127 } |
| 120 | 128 |
| 121 static_library("cld2_dynamic") { | 129 static_library("cld2_dynamic") { |
| 122 sources = core_files + data_loader_files | 130 sources = core_files + data_loader_files |
| 123 all_dependent_configs = [ ":cld2_dynamic_mode_config" ] | |
| 124 include_dirs = [ | 131 include_dirs = [ |
| 125 "src/internal", | 132 "src/internal", |
| 126 "src/public", | 133 "src/public", |
| 127 ] | 134 ] |
| 128 | 135 |
| 129 configs -= [ "//build/config/compiler:chromium_code" ] | 136 configs -= [ "//build/config/compiler:chromium_code" ] |
| 130 configs += [ "//build/config/compiler:no_chromium_code" ] | 137 configs += [ "//build/config/compiler:no_chromium_code", ":cld2_dynamic_mode_c
onfig" ] |
| 131 | 138 |
| 132 if (is_win) { | 139 if (is_win) { |
| 133 cflags = [ "/wd4267" ] # size_t -> int conversion. | 140 cflags = [ "/wd4267" ] # size_t -> int conversion. |
| 134 } | 141 } |
| 135 } | 142 } |
| 136 | 143 |
| 137 # Does not build on Windows. | 144 # Does not build on Windows. |
| 138 if (!is_win) { | 145 if (!is_win) { |
| 139 executable("cld_2_dynamic_data_tool") { | 146 executable("cld_2_dynamic_data_tool") { |
| 140 sources = [ | 147 sources = [ |
| 141 "src/internal/cld2_dynamic_data_extractor.h", | 148 "src/internal/cld2_dynamic_data_extractor.h", |
| 142 "src/internal/cld2_dynamic_data_extractor.cc", | 149 "src/internal/cld2_dynamic_data_extractor.cc", |
| 143 "src/internal/cld2_dynamic_data_tool.cc", | 150 "src/internal/cld2_dynamic_data_tool.cc", |
| 144 ] | 151 ] |
| 145 | 152 |
| 146 include_dirs = [ | 153 include_dirs = [ |
| 147 "src/internal", | 154 "src/internal", |
| 148 "src/public", | 155 "src/public", |
| 149 ] | 156 ] |
| 150 | 157 |
| 151 deps = [ ":cld2_data", ":cld2_dynamic" ] | 158 deps = [ ":cld2_data", ":cld2_dynamic" ] |
| 152 | 159 |
| 153 configs -= [ "//build/config/compiler:chromium_code" ] | 160 configs -= [ "//build/config/compiler:chromium_code" ] |
| 154 configs += [ "//build/config/compiler:no_chromium_code" ] | 161 configs += [ "//build/config/compiler:no_chromium_code", ":cld2_dynamic_mode
_config" ] |
| 155 | 162 |
| 156 if (is_win) { | 163 if (is_win) { |
| 157 cflags = [ "/wd4267" ] # size_t -> int conversion. | 164 cflags = [ "/wd4267" ] # size_t -> int conversion. |
| 158 } | 165 } |
| 159 } | 166 } |
| 160 } | 167 } |
| OLD | NEW |