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