blob: f1bcb15696b088bde2f320b7d6b30e95385a1c74 [file] [log] [blame]
Matt Sharifibda09f12017-03-10 12:29:15 +01001# Copyright (C) 2017 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
15# ------------------------
16# libtextclassifier_protos
17# ------------------------
18
19LOCAL_PATH := $(call my-dir)
20include $(CLEAR_VARS)
21
22LOCAL_MODULE := libtextclassifier_protos
23
24LOCAL_SRC_FILES := $(call all-proto-files-under, .)
25LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite
26
27include $(BUILD_STATIC_LIBRARY)
28
29# -----------------
30# libtextclassifier
31# -----------------
32
Matt Sharifid40f9762017-03-14 21:24:23 +010033libtextclassifier_cflags := -Wno-unused-parameter \
Matt Sharifibda09f12017-03-10 12:29:15 +010034 -Wno-sign-compare \
35 -Wno-missing-field-initializers \
36 -Wno-ignored-qualifiers \
37 -Wno-undefined-var-template
38
Matt Sharifid40f9762017-03-14 21:24:23 +010039include $(CLEAR_VARS)
40LOCAL_MODULE := libtextclassifier
41
42proto_sources_dir := $(generated_sources_dir)
43
44LOCAL_CPP_EXTENSION := .cc
45LOCAL_CFLAGS += $(libtextclassifier_cflags)
46
Matt Sharifibda09f12017-03-10 12:29:15 +010047LOCAL_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
Matt Sharifid40f9762017-03-14 21:24:23 +010048 find . -name "*.cc" -and -not -name ".*" -and -not -path "./tests/*"))
Matt Sharifibda09f12017-03-10 12:29:15 +010049LOCAL_C_INCLUDES += .
Matt Sharifid40f9762017-03-14 21:24:23 +010050LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
Matt Sharifibda09f12017-03-10 12:29:15 +010051
52LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite
53LOCAL_STATIC_LIBRARIES := libtextclassifier_protos
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000054LOCAL_REQUIRED_MODULES := textclassifier.langid.model
Matt Sharifibda09f12017-03-10 12:29:15 +010055
56include $(BUILD_SHARED_LIBRARY)
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000057
Matt Sharifid40f9762017-03-14 21:24:23 +010058# -----------------------
59# libtextclassifier_tests
60# -----------------------
61
62include $(CLEAR_VARS)
63
64LOCAL_MODULE := libtextclassifier_tests
65LOCAL_MODULE_TAGS := tests
66
67LOCAL_CPP_EXTENSION := .cc
68LOCAL_CFLAGS += $(libtextclassifier_cflags)
69
70LOCAL_TEST_DATA := $(call find-test-data-in-subdirs, $(LOCAL_PATH), *, tests/testdata)
71
72LOCAL_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
73 find . -name "*.cc" -and -not -name ".*"))
74LOCAL_C_INCLUDES += .
75LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
76
77LOCAL_STATIC_LIBRARIES := libtextclassifier_protos libgmock
78LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite
79
80include $(BUILD_NATIVE_TEST)
81
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000082# ------------
83# LangId model
84# ------------
85
86include $(CLEAR_VARS)
87LOCAL_MODULE := textclassifier.langid.model
88LOCAL_MODULE_CLASS := ETC
89LOCAL_MODULE_TAGS := optional
90LOCAL_MODULE_OWNER := google
91LOCAL_SRC_FILES := ./models/textclassifier.langid.model
92LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
93include $(BUILD_PREBUILT)
94
95# ----------------------
96# Smart Selection models
97# ----------------------
98
99include $(CLEAR_VARS)
100LOCAL_MODULE := textclassifier.smartselection.en.model
101LOCAL_MODULE_CLASS := ETC
102LOCAL_MODULE_TAGS := optional
103LOCAL_MODULE_OWNER := google
104LOCAL_SRC_FILES := ./models/textclassifier.smartselection.en.model
105LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
106include $(BUILD_PREBUILT)
107