1# 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
15LOCAL_PATH := $(call my-dir)
16
17include $(CLEAR_VARS)
18# Generate unicode emoji data from UCD.
19UNICODE_EMOJI_H_GEN_PY := $(LOCAL_PATH)/unicode_emoji_h_gen.py
20UNICODE_EMOJI_DATA := $(TOP)/external/unicode/emoji-data.txt
21
22UNICODE_EMOJI_H := $(intermediates)/generated/UnicodeData.h
23$(UNICODE_EMOJI_H): $(UNICODE_EMOJI_H_GEN_PY) $(UNICODE_EMOJI_DATA)
24$(LOCAL_PATH)/MinikinInternal.cpp: $(UNICODE_EMOJI_H)
25$(UNICODE_EMOJI_H): PRIVATE_CUSTOM_TOOL := python $(UNICODE_EMOJI_H_GEN_PY) \
26    -i $(UNICODE_EMOJI_DATA) \
27    -o $(UNICODE_EMOJI_H)
28$(UNICODE_EMOJI_H):
29		$(transform-generated-source)
30
31include $(CLEAR_VARS)
32minikin_src_files := \
33    AnalyzeStyle.cpp \
34    CmapCoverage.cpp \
35    FontCollection.cpp \
36    FontFamily.cpp \
37    FontLanguage.cpp \
38    FontLanguageListCache.cpp \
39    GraphemeBreak.cpp \
40    HbFontCache.cpp \
41    Hyphenator.cpp \
42    Layout.cpp \
43    LayoutUtils.cpp \
44    LineBreaker.cpp \
45    Measurement.cpp \
46    MinikinInternal.cpp \
47    MinikinRefCounted.cpp \
48    MinikinFont.cpp \
49    MinikinFontFreeType.cpp \
50    SparseBitSet.cpp \
51    WordBreaker.cpp
52
53minikin_c_includes := \
54    external/harfbuzz_ng/src \
55    external/freetype/include \
56    frameworks/minikin/include \
57    $(intermediates)
58
59minikin_shared_libraries := \
60    libharfbuzz_ng \
61    libft2 \
62    liblog \
63    libz \
64    libicuuc \
65    libutils
66
67ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
68# Enable race detection on eng and userdebug build.
69enable_race_detection := -DENABLE_RACE_DETECTION
70else
71enable_race_detection :=
72endif
73
74LOCAL_MODULE := libminikin
75LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include
76LOCAL_SRC_FILES := $(minikin_src_files)
77LOCAL_C_INCLUDES := $(minikin_c_includes)
78LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection)
79LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries)
80LOCAL_CLANG := true
81LOCAL_SANITIZE := signed-integer-overflow
82# b/26432628.
83#LOCAL_SANITIZE += unsigned-integer-overflow
84
85include $(BUILD_SHARED_LIBRARY)
86
87include $(CLEAR_VARS)
88
89LOCAL_MODULE := libminikin
90LOCAL_MODULE_TAGS := optional
91LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include
92LOCAL_SRC_FILES := $(minikin_src_files)
93LOCAL_C_INCLUDES := $(minikin_c_includes)
94LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection)
95LOCAL_SHARED_LIBRARIES := $(minikin_shared_libraries)
96LOCAL_CLANG := true
97LOCAL_SANITIZE := signed-integer-overflow
98# b/26432628.
99#LOCAL_SANITIZE += unsigned-integer-overflow
100
101include $(BUILD_STATIC_LIBRARY)
102
103include $(CLEAR_VARS)
104
105# Reduced library (currently just hyphenation) for host
106
107LOCAL_MODULE := libminikin_host
108LOCAL_MODULE_TAGS := optional
109LOCAL_EXPORT_C_INCLUDE_DIRS := frameworks/minikin/include
110LOCAL_C_INCLUDES := $(minikin_c_includes)
111LOCAL_CPPFLAGS += -Werror -Wall -Wextra $(enable_race_detection)
112LOCAL_SHARED_LIBRARIES := liblog libicuuc-host
113
114LOCAL_SRC_FILES := Hyphenator.cpp
115
116include $(BUILD_HOST_STATIC_LIBRARY)
117