blob: 204a97a268af168bd71c077aa85c2b13feb51542 [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
Matt Sharifibe876dc2017-03-17 17:02:43 +010073LOCAL_CPPFLAGS_32 += -DTEST_DATA_DIR="\"/data/nativetest/libtextclassifier_tests/tests/testdata/\""
74LOCAL_CPPFLAGS_64 += -DTEST_DATA_DIR="\"/data/nativetest64/libtextclassifier_tests/tests/testdata/\""
75
Matt Sharifid40f9762017-03-14 21:24:23 +010076LOCAL_SRC_FILES := $(patsubst ./%,%, $(shell cd $(LOCAL_PATH); \
77 find . -name "*.cc" -and -not -name ".*"))
78LOCAL_C_INCLUDES += .
79LOCAL_C_INCLUDES += $(proto_sources_dir)/proto/external/libtextclassifier
80
81LOCAL_STATIC_LIBRARIES := libtextclassifier_protos libgmock
82LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite
83
84include $(BUILD_NATIVE_TEST)
85
Abodunrinwa Toki61f99dd2017-03-14 18:16:15 +000086# ------------
87# LangId model
88# ------------
89
90include $(CLEAR_VARS)
91LOCAL_MODULE := textclassifier.langid.model
92LOCAL_MODULE_CLASS := ETC
93LOCAL_MODULE_TAGS := optional
94LOCAL_MODULE_OWNER := google
95LOCAL_SRC_FILES := ./models/textclassifier.langid.model
96LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
97include $(BUILD_PREBUILT)
98
99# ----------------------
100# Smart Selection models
101# ----------------------
102
103include $(CLEAR_VARS)
104LOCAL_MODULE := textclassifier.smartselection.en.model
105LOCAL_MODULE_CLASS := ETC
106LOCAL_MODULE_TAGS := optional
107LOCAL_MODULE_OWNER := google
108LOCAL_SRC_FILES := ./models/textclassifier.smartselection.en.model
109LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/textclassifier
110include $(BUILD_PREBUILT)
111