blob: 3bf70ad49c5228ba61209d47f351bbd6c180b359 [file] [log] [blame]
Dan Willemsena23407b2018-10-24 17:44:49 -07001// Copyright (C) 2013 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15filegroup {
16 name: "LATIN_IME_CORE_SRC_FILES",
17 srcs: [
18 "src/dictionary/header/header_policy.cpp",
19 "src/dictionary/header/header_read_write_utils.cpp",
20 "src/dictionary/property/ngram_context.cpp",
21 "src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.cpp",
22 "src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.cpp",
23 "src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp",
24 "src/dictionary/structure/pt_common/dynamic_pt_reading_helper.cpp",
25 "src/dictionary/structure/pt_common/dynamic_pt_reading_utils.cpp",
26 "src/dictionary/structure/pt_common/dynamic_pt_updating_helper.cpp",
27 "src/dictionary/structure/pt_common/dynamic_pt_writing_utils.cpp",
28 "src/dictionary/structure/pt_common/patricia_trie_reading_utils.cpp",
29 "src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp",
30 "src/dictionary/structure/v2/patricia_trie_policy.cpp",
31 "src/dictionary/structure/v2/ver2_patricia_trie_node_reader.cpp",
32 "src/dictionary/structure/v2/ver2_pt_node_array_reader.cpp",
33 "src/dictionary/structure/v4/ver4_dict_buffers.cpp",
34 "src/dictionary/structure/v4/ver4_dict_constants.cpp",
35 "src/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp",
36 "src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp",
37 "src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp",
38 "src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.cpp",
39 "src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.cpp",
40 "src/dictionary/structure/v4/ver4_pt_node_array_reader.cpp",
41 "src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.cpp",
42 "src/dictionary/structure/v4/content/language_model_dict_content.cpp",
43 "src/dictionary/structure/v4/content/language_model_dict_content_global_counters.cpp",
44 "src/dictionary/structure/v4/content/shortcut_dict_content.cpp",
45 "src/dictionary/structure/v4/content/sparse_table_dict_content.cpp",
46 "src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp",
47 "src/dictionary/utils/buffer_with_extendable_buffer.cpp",
48 "src/dictionary/utils/byte_array_utils.cpp",
49 "src/dictionary/utils/dict_file_writing_utils.cpp",
50 "src/dictionary/utils/file_utils.cpp",
51 "src/dictionary/utils/forgetting_curve_utils.cpp",
52 "src/dictionary/utils/format_utils.cpp",
53 "src/dictionary/utils/mmapped_buffer.cpp",
54 "src/dictionary/utils/multi_bigram_map.cpp",
55 "src/dictionary/utils/probability_utils.cpp",
56 "src/dictionary/utils/sparse_table.cpp",
57 "src/dictionary/utils/trie_map.cpp",
58 "src/suggest/core/suggest.cpp",
59 "src/suggest/core/dicnode/dic_node.cpp",
60 "src/suggest/core/dicnode/dic_node_utils.cpp",
61 "src/suggest/core/dicnode/dic_nodes_cache.cpp",
62 "src/suggest/core/dictionary/dictionary.cpp",
63 "src/suggest/core/dictionary/dictionary_utils.cpp",
64 "src/suggest/core/dictionary/digraph_utils.cpp",
65 "src/suggest/core/dictionary/error_type_utils.cpp",
66 "src/suggest/core/layout/additional_proximity_chars.cpp",
67 "src/suggest/core/layout/proximity_info.cpp",
68 "src/suggest/core/layout/proximity_info_params.cpp",
69 "src/suggest/core/layout/proximity_info_state.cpp",
70 "src/suggest/core/layout/proximity_info_state_utils.cpp",
71 "src/suggest/core/policy/weighting.cpp",
72 "src/suggest/core/session/dic_traverse_session.cpp",
73 "src/suggest/core/result/suggestion_results.cpp",
74 "src/suggest/core/result/suggestions_output_utils.cpp",
75 "src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp",
76 "src/suggest/policyimpl/typing/scoring_params.cpp",
77 "src/suggest/policyimpl/typing/typing_scoring.cpp",
78 "src/suggest/policyimpl/typing/typing_suggest_policy.cpp",
79 "src/suggest/policyimpl/typing/typing_traversal.cpp",
80 "src/suggest/policyimpl/typing/typing_weighting.cpp",
81 "src/utils/autocorrection_threshold_utils.cpp",
82 "src/utils/char_utils.cpp",
83 "src/utils/jni_data_utils.cpp",
84 "src/utils/log_utils.cpp",
85 "src/utils/time_keeper.cpp",
86
87 // BACKWARD_V402
88 "src/dictionary/structure/backward/v402/ver4_dict_buffers.cpp",
89 "src/dictionary/structure/backward/v402/ver4_dict_constants.cpp",
90 "src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.cpp",
91 "src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp",
92 "src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp",
93 "src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.cpp",
94 "src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.cpp",
95 "src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.cpp",
96 "src/dictionary/structure/backward/v402/content/bigram_dict_content.cpp",
97 "src/dictionary/structure/backward/v402/content/probability_dict_content.cpp",
98 "src/dictionary/structure/backward/v402/content/shortcut_dict_content.cpp",
99 "src/dictionary/structure/backward/v402/content/sparse_table_dict_content.cpp",
100 "src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp",
101 "src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.cpp",
102 ],
103}
104
105cc_library {
106 name: "libjni_latinime",
107 host_supported: true,
108
109 sdk_version: "14",
110 cflags: [
111 "-Werror",
112 "-Wall",
113 "-Wextra",
114 "-Weffc++",
115 "-Wformat=2",
116 "-Wcast-qual",
117 "-Wcast-align",
118 "-Wwrite-strings",
119 "-Wfloat-equal",
120 "-Wpointer-arith",
121 "-Winit-self",
122 "-Wredundant-decls",
123 "-Woverloaded-virtual",
124 "-Wsign-promo",
125 "-Wno-system-headers",
126
127 // To suppress compiler warnings for unused variables/functions used for debug features etc.
128 "-Wno-unused-parameter",
129 "-Wno-unused-function",
130 ],
131 local_include_dirs: ["src"],
132
133 srcs: [
134 "com_android_inputmethod_keyboard_ProximityInfo.cpp",
135 "com_android_inputmethod_latin_BinaryDictionary.cpp",
136 "com_android_inputmethod_latin_BinaryDictionaryUtils.cpp",
137 "com_android_inputmethod_latin_DicTraverseSession.cpp",
138 "jni_common.cpp",
139
140 ":LATIN_IME_CORE_SRC_FILES",
141 ],
142
143 target: {
144 android_x86: {
145 // HACK: -mstackrealign is required for x86 builds running on pre-KitKat devices to avoid crashes
146 // with SSE instructions.
147 cflags: ["-mstackrealign"],
148 },
149 android: {
150 stl: "libc++_static",
151 },
152 host: {
153 cflags: ["-DHOST_TOOL"],
154 },
155 },
156}
157
158cc_library_static {
159 name: "liblatinime_static_for_unittests",
160 host_supported: true,
161
162 cflags: [
163 "-Wno-unused-parameter",
164 "-Wno-unused-function",
165 "-Wall",
166 "-Werror",
167 ],
168 local_include_dirs: ["src"],
169 sdk_version: "14",
170 stl: "libc++_static",
171
172 srcs: [":LATIN_IME_CORE_SRC_FILES"],
173}
174
175cc_test {
176 name: "liblatinime_unittests",
177 host_supported: true,
178
179 cflags: [
180 "-Wno-unused-parameter",
181 "-Wno-unused-function",
182 "-Wall",
183 "-Werror",
184 ],
185 local_include_dirs: ["src"],
186 sdk_version: "14",
187 stl: "libc++_static",
188
189 srcs: [
190 "tests/defines_test.cpp",
191 "tests/dictionary/header/header_read_write_utils_test.cpp",
192 "tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp",
193 "tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp",
194 "tests/dictionary/structure/v4/content/probability_entry_test.cpp",
195 "tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp",
196 "tests/dictionary/utils/bloom_filter_test.cpp",
197 "tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp",
198 "tests/dictionary/utils/byte_array_utils_test.cpp",
199 "tests/dictionary/utils/format_utils_test.cpp",
200 "tests/dictionary/utils/probability_utils_test.cpp",
201 "tests/dictionary/utils/sparse_table_test.cpp",
202 "tests/dictionary/utils/trie_map_test.cpp",
203 "tests/suggest/core/dicnode/dic_node_pool_test.cpp",
204 "tests/suggest/core/layout/geometry_utils_test.cpp",
205 "tests/suggest/core/layout/normal_distribution_2d_test.cpp",
206 "tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp",
207 "tests/utils/autocorrection_threshold_utils_test.cpp",
208 "tests/utils/char_utils_test.cpp",
209 "tests/utils/int_array_view_test.cpp",
210 "tests/utils/time_keeper_test.cpp",
211 ],
212 static_libs: ["liblatinime_static_for_unittests"],
213}