blob: b522cb3bd55f9fc2bbf14e7804933cc38e5c6eeb [file] [log] [blame]
Dan Willemsen22ebec62018-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,
Anton Hansson1c429e32019-01-11 14:56:36 +0000108 product_specific: true,
Dan Willemsen22ebec62018-10-24 17:44:49 -0700109
110 sdk_version: "14",
111 cflags: [
112 "-Werror",
113 "-Wall",
114 "-Wextra",
115 "-Weffc++",
116 "-Wformat=2",
117 "-Wcast-qual",
118 "-Wcast-align",
119 "-Wwrite-strings",
120 "-Wfloat-equal",
121 "-Wpointer-arith",
122 "-Winit-self",
123 "-Wredundant-decls",
124 "-Woverloaded-virtual",
125 "-Wsign-promo",
126 "-Wno-system-headers",
127 "-Wno-format-nonliteral",
128
129 // To suppress compiler warnings for unused variables/functions used for debug features etc.
130 "-Wno-unused-parameter",
131 "-Wno-unused-function",
132 ],
Orion Hodson54c4f2a2020-04-03 12:45:16 +0100133 header_libs: ["jni_headers"],
Dan Willemsen22ebec62018-10-24 17:44:49 -0700134 local_include_dirs: ["src"],
135
136 srcs: [
137 "com_android_inputmethod_keyboard_ProximityInfo.cpp",
138 "com_android_inputmethod_latin_BinaryDictionary.cpp",
139 "com_android_inputmethod_latin_BinaryDictionaryUtils.cpp",
140 "com_android_inputmethod_latin_DicTraverseSession.cpp",
141 "jni_common.cpp",
142
143 ":LATIN_IME_CORE_SRC_FILES",
144 ],
145
146 target: {
147 android_x86: {
148 // HACK: -mstackrealign is required for x86 builds running on pre-KitKat devices to avoid crashes
149 // with SSE instructions.
150 cflags: ["-mstackrealign"],
151 },
152 android: {
153 stl: "libc++_static",
154 },
155 host: {
156 cflags: ["-DHOST_TOOL"],
157 },
158 },
159}
160
161cc_library_static {
162 name: "liblatinime_static_for_unittests",
163 host_supported: true,
164
165 cflags: [
166 "-Wno-unused-parameter",
167 "-Wno-unused-function",
168 "-Wall",
169 "-Werror",
170 ],
Orion Hodson54c4f2a2020-04-03 12:45:16 +0100171 header_libs: ["jni_headers"],
Dan Willemsen22ebec62018-10-24 17:44:49 -0700172 local_include_dirs: ["src"],
173 sdk_version: "14",
174 stl: "libc++_static",
175
176 srcs: [":LATIN_IME_CORE_SRC_FILES"],
177}
178
179cc_test {
180 name: "liblatinime_unittests",
181 host_supported: true,
Julien Desprezb19114e2021-02-16 18:31:02 +0000182 test_options: {
183 unit_test: true,
184 },
Dan Willemsen22ebec62018-10-24 17:44:49 -0700185 cflags: [
186 "-Wno-unused-parameter",
187 "-Wno-unused-function",
188 "-Wall",
189 "-Werror",
190 ],
191 local_include_dirs: ["src"],
192 sdk_version: "14",
193 stl: "libc++_static",
194
195 srcs: [
196 "tests/defines_test.cpp",
197 "tests/dictionary/header/header_read_write_utils_test.cpp",
198 "tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp",
199 "tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp",
200 "tests/dictionary/structure/v4/content/probability_entry_test.cpp",
201 "tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp",
202 "tests/dictionary/utils/bloom_filter_test.cpp",
203 "tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp",
204 "tests/dictionary/utils/byte_array_utils_test.cpp",
205 "tests/dictionary/utils/format_utils_test.cpp",
206 "tests/dictionary/utils/probability_utils_test.cpp",
207 "tests/dictionary/utils/sparse_table_test.cpp",
208 "tests/dictionary/utils/trie_map_test.cpp",
209 "tests/suggest/core/dicnode/dic_node_pool_test.cpp",
210 "tests/suggest/core/layout/geometry_utils_test.cpp",
211 "tests/suggest/core/layout/normal_distribution_2d_test.cpp",
212 "tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp",
213 "tests/utils/autocorrection_threshold_utils_test.cpp",
214 "tests/utils/char_utils_test.cpp",
215 "tests/utils/int_array_view_test.cpp",
216 "tests/utils/time_keeper_test.cpp",
217 ],
218 static_libs: ["liblatinime_static_for_unittests"],
219}