blob: 823815d10755dfa1cd0d4a69fa5638f872a6fe9d [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
Abodunrinwa Toki72282c62017-03-15 19:30:31 +000055LOCAL_REQUIRED_MODULES += textclassifier.smartselection.en.model
Matt Sharifibda09f12017-03-10 12:29:15 +010056
57include $(BUILD_SHARED_LIBRARY)
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000058
Matt Sharifid40f9762017-03-14 21:24:23 +010059# -----------------------
60# libtextclassifier_tests
61# -----------------------
62
63include $(CLEAR_VARS)
64
65LOCAL_MODULE := libtextclassifier_tests
66LOCAL_MODULE_TAGS := tests
67
68LOCAL_CPP_EXTENSION := .cc
69LOCAL_CFLAGS += $(libtextclassifier_cflags)
70
71LOCAL_TEST_DATA := $(call find-test-data-in-subdirs, $(LOCAL_PATH), *, tests/testdata)
72
73LOCAL_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
74 find . -name "*.cc" -and -not -name ".*"))
75LOCAL_C_INCLUDES += .
76LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
77
78LOCAL_STATIC_LIBRARIES := libtextclassifier_protos libgmock
79LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite
80
81include $(BUILD_NATIVE_TEST)
82
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000083# ------------
84# LangId model
85# ------------
86
87include $(CLEAR_VARS)
88LOCAL_MODULE := textclassifier.langid.model
89LOCAL_MODULE_CLASS := ETC
90LOCAL_MODULE_TAGS := optional
91LOCAL_MODULE_OWNER := google
92LOCAL_SRC_FILES := ./models/textclassifier.langid.model
93LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
94include $(BUILD_PREBUILT)
95
96# ----------------------
97# Smart Selection models
98# ----------------------
99
100include $(CLEAR_VARS)
101LOCAL_MODULE := textclassifier.smartselection.en.model
102LOCAL_MODULE_CLASS := ETC
103LOCAL_MODULE_TAGS := optional
104LOCAL_MODULE_OWNER := google
105LOCAL_SRC_FILES := ./models/textclassifier.smartselection.en.model
106LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
107include $(BUILD_PREBUILT)
108