1# Copyright (C) 2014 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
15ifeq (,$(TARGET_BUILD_APPS))
16
17LOCAL_PATH := $(call my-dir)
18
19######################################
20include $(CLEAR_VARS)
21
22LATIN_IME_CORE_PATH := $(LOCAL_PATH)/../jni
23
24LATIN_IME_DICT_TOOLKIT_SRC_DIR := src
25LATIN_IME_CORE_SRC_DIR := ../jni/src
26LATIN_DICT_TOOLKIT_TEST_SRC_DIR := tests
27
28include $(LOCAL_PATH)/NativeFileList.mk
29include $(LATIN_IME_CORE_PATH)/NativeFileList.mk
30
31LATIN_IME_SRC_DIR := src
32LOCAL_ADDRESS_SANITIZER := true
33LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
34LOCAL_CLANG := true
35LOCAL_CXX_STL := libc++
36LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_DICT_TOOLKIT_SRC_DIR) \
37    $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR)
38LOCAL_MODULE := liblatinime_dicttoolkit_host_static_for_unittests
39LOCAL_MODULE_TAGS := optional
40LOCAL_SRC_FILES := \
41    $(addprefix $(LATIN_IME_DICT_TOOLKIT_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_SRC_FILES)) \
42    $(addprefix $(LATIN_IME_CORE_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES))
43include $(BUILD_HOST_STATIC_LIBRARY)
44
45include $(CLEAR_VARS)
46
47LOCAL_ADDRESS_SANITIZER := true
48LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function
49LOCAL_CLANG := true
50LOCAL_CXX_STL := libc++
51LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_DICT_TOOLKIT_SRC_DIR) \
52    $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR)
53LOCAL_MODULE := dicttoolkit_unittests
54LOCAL_MODULE_TAGS := tests
55LOCAL_SRC_FILES := \
56    $(addprefix $(LATIN_DICT_TOOLKIT_TEST_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_TEST_FILES))
57LOCAL_STATIC_LIBRARIES += liblatinime_dicttoolkit_host_static_for_unittests
58include $(BUILD_HOST_NATIVE_TEST)
59
60include $(LOCAL_PATH)/CleanupNativeFileList.mk
61
62#################### Clean up the tmp vars
63LATINIME_HOST_OSNAME :=
64LATIN_IME_SRC_DIR :=
65LATIN_IME_TEST_SRC_DIR :=
66
67endif # TARGET_BUILD_APPS
68