Android.mk revision e702c9cd6a2b9b1378f740a79b0e349a9b02660f
1LOCAL_PATH:= $(call my-dir)
2include $(CLEAR_VARS)
3LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
4
5hwui_src_files := \
6    font/CacheTexture.cpp \
7    font/Font.cpp \
8    renderstate/Blend.cpp \
9    renderstate/MeshState.cpp \
10    renderstate/PixelBufferState.cpp \
11    renderstate/RenderState.cpp \
12    renderstate/Scissor.cpp \
13    renderstate/Stencil.cpp \
14    renderstate/TextureState.cpp \
15    renderthread/CanvasContext.cpp \
16    renderthread/DrawFrameTask.cpp \
17    renderthread/EglManager.cpp \
18    renderthread/RenderProxy.cpp \
19    renderthread/RenderTask.cpp \
20    renderthread/RenderThread.cpp \
21    renderthread/TimeLord.cpp \
22    thread/TaskManager.cpp \
23    utils/Blur.cpp \
24    utils/GLUtils.cpp \
25    utils/LinearAllocator.cpp \
26    utils/NinePatchImpl.cpp \
27    utils/StringUtils.cpp \
28    AmbientShadow.cpp \
29    AnimationContext.cpp \
30    Animator.cpp \
31    AnimatorManager.cpp \
32    AssetAtlas.cpp \
33    Caches.cpp \
34    CanvasState.cpp \
35    ClipArea.cpp \
36    DamageAccumulator.cpp \
37    DeferredDisplayList.cpp \
38    DeferredLayerUpdater.cpp \
39    DisplayList.cpp \
40    DisplayListCanvas.cpp \
41    Dither.cpp \
42    Extensions.cpp \
43    FboCache.cpp \
44    FontRenderer.cpp \
45    FrameInfo.cpp \
46    FrameInfoVisualizer.cpp \
47    GammaFontRenderer.cpp \
48    GlopBuilder.cpp \
49    GradientCache.cpp \
50    Image.cpp \
51    Interpolator.cpp \
52    JankTracker.cpp \
53    Layer.cpp \
54    LayerCache.cpp \
55    LayerRenderer.cpp \
56    Matrix.cpp \
57    OpenGLRenderer.cpp \
58    Patch.cpp \
59    PatchCache.cpp \
60    PathCache.cpp \
61    PathTessellator.cpp \
62    PixelBuffer.cpp \
63    Program.cpp \
64    ProgramCache.cpp \
65    Properties.cpp \
66    RenderBufferCache.cpp \
67    RenderNode.cpp \
68    RenderProperties.cpp \
69    ResourceCache.cpp \
70    ShadowTessellator.cpp \
71    SkiaCanvas.cpp \
72    SkiaCanvasProxy.cpp \
73    SkiaShader.cpp \
74    Snapshot.cpp \
75    SpotShadow.cpp \
76    TessellationCache.cpp \
77    TextDropShadowCache.cpp \
78    Texture.cpp \
79    TextureCache.cpp \
80    protos/hwui.proto
81
82hwui_cflags := \
83    -DEGL_EGLEXT_PROTOTYPES -DGL_GLEXT_PROTOTYPES \
84    -DATRACE_TAG=ATRACE_TAG_VIEW -DLOG_TAG=\"OpenGLRenderer\" \
85    -Wall -Wno-unused-parameter -Wunreachable-code \
86    -ffast-math -O3 -Werror
87
88ifndef HWUI_COMPILE_SYMBOLS
89    hwui_cflags += -fvisibility=hidden
90endif
91
92ifdef HWUI_COMPILE_FOR_PERF
93    # TODO: Non-arm?
94    hwui_cflags += -fno-omit-frame-pointer -marm -mapcs
95endif
96
97# This has to be lazy-resolved because it depends on the LOCAL_MODULE_CLASS
98# which varies depending on what is being built
99define hwui_proto_include
100$(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
101endef
102
103hwui_c_includes += \
104    external/skia/src/core
105
106hwui_shared_libraries := \
107    liblog \
108    libcutils \
109    libutils \
110    libEGL \
111    libGLESv2 \
112    libskia \
113    libui \
114    libgui \
115    libprotobuf-cpp-lite \
116
117ifneq (false,$(ANDROID_ENABLE_RENDERSCRIPT))
118    hwui_cflags += -DANDROID_ENABLE_RENDERSCRIPT
119    hwui_shared_libraries += libRS libRScpp
120    hwui_c_includes += \
121        $(call intermediates-dir-for,STATIC_LIBRARIES,libRS,TARGET,) \
122        frameworks/rs/cpp \
123        frameworks/rs
124endif
125
126
127# ------------------------
128# static library
129# ------------------------
130
131include $(CLEAR_VARS)
132
133LOCAL_MODULE_CLASS := STATIC_LIBRARIES
134LOCAL_MODULE := libhwui_static
135LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
136LOCAL_CFLAGS := $(hwui_cflags)
137LOCAL_SRC_FILES := $(hwui_src_files)
138LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
139LOCAL_EXPORT_C_INCLUDE_DIRS := $(hwui_c_includes) $(call hwui_proto_include)
140
141include $(BUILD_STATIC_LIBRARY)
142
143# ------------------------
144# shared library
145# ------------------------
146
147include $(CLEAR_VARS)
148
149LOCAL_MODULE_CLASS := SHARED_LIBRARIES
150LOCAL_MODULE := libhwui
151LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
152LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
153
154include $(BUILD_SHARED_LIBRARY)
155
156# ------------------------
157# unit tests
158# ------------------------
159
160include $(CLEAR_VARS)
161
162LOCAL_MODULE := hwui_unit_tests
163LOCAL_MODULE_TAGS := tests
164LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
165LOCAL_STATIC_LIBRARIES := libhwui_static
166LOCAL_CFLAGS := $(hwui_cflags)
167
168LOCAL_SRC_FILES += \
169    unit_tests/CanvasStateTests.cpp \
170    unit_tests/ClipAreaTests.cpp \
171    unit_tests/DamageAccumulatorTests.cpp \
172    unit_tests/LinearAllocatorTests.cpp \
173    unit_tests/StringUtilsTests.cpp
174
175include $(BUILD_NATIVE_TEST)
176
177# ------------------------
178# test app
179# ------------------------
180
181include $(CLEAR_VARS)
182
183LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/local/tmp
184LOCAL_MODULE:= hwuitest
185LOCAL_MODULE_TAGS := tests
186LOCAL_MODULE_CLASS := EXECUTABLES
187LOCAL_MULTILIB := both
188LOCAL_MODULE_STEM_32 := hwuitest
189LOCAL_MODULE_STEM_64 := hwuitest64
190LOCAL_SHARED_LIBRARIES := $(hwui_shared_libraries)
191LOCAL_CFLAGS := $(hwui_cflags)
192
193HWUI_NULL_GPU := false
194
195ifeq (true, $(HWUI_NULL_GPU))
196    # Only need to specify the includes if we are not linking against
197    # libhwui_static as libhwui_static exports the appropriate includes
198    LOCAL_C_INCLUDES := $(hwui_c_includes) $(call hwui_proto_include)
199
200    LOCAL_SRC_FILES := \
201        $(hwui_src_files) \
202        tests/nullegl.cpp \
203        tests/nullgles.cpp
204
205    LOCAL_CFLAGS += -DHWUI_NULL_GPU
206else
207    LOCAL_WHOLE_STATIC_LIBRARIES := libhwui_static
208endif
209
210LOCAL_SRC_FILES += \
211    tests/TestContext.cpp \
212    tests/TreeContentAnimation.cpp \
213    tests/main.cpp
214
215include $(BUILD_EXECUTABLE)
216