blob: b287807a69f212c226855848f8b653b11bd3d9d8 [file] [log] [blame]
Alex Vakulenkoe4eec202017-01-27 14:41:04 -08001# Copyright (C) 2016 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.
14LOCAL_PATH := $(call my-dir)
15
16include_dirs := \
17 $(LOCAL_PATH)/include \
18 $(LOCAL_PATH)/prebuilt/include
19
20# Java platform library for the system implementation of the GVR API.
21include $(CLEAR_VARS)
22LOCAL_MODULE := gvr_platform
23LOCAL_MODULE_STEM := com.google.vr.gvr.platform
24LOCAL_REQUIRED_MODULES := libgvr_system_loader libgvr_system
25LOCAL_SRC_FILES := $(call all-subdir-java-files)
26include $(BUILD_JAVA_LIBRARY)
27
28# Library to perform dlopen on the actual platform library.
29include $(CLEAR_VARS)
30LOCAL_MODULE := libgvr_system_loader
31LOCAL_SRC_FILES := library_loader.cpp
32include $(BUILD_SHARED_LIBRARY)
33
34# Shared library implementing the GVR API.
35include $(CLEAR_VARS)
36LOCAL_MODULE := libgvr_system
37
38LOCAL_SRC_FILES := \
39 shim_gvr.cpp \
40 shim_gvr_controller.cpp \
41 shim_gvr_private.cpp \
42 deviceparams/CardboardDevice.nolite.proto
43
44LOCAL_MODULE_CLASS := SHARED_LIBRARIES
45
46LOCAL_C_INCLUDES := $(include_dirs)
47LOCAL_C_INCLUDES += $(call local-generated-sources-dir)/proto/$(LOCAL_PATH)
48LOCAL_EXPORT_C_INCLUDE_DIRS := $(include_dirs)
49
50gvr_api_linker_script := $(LOCAL_PATH)/exported_apis.lds
51LOCAL_ADDITIONAL_DEPENDENCIES := $(gvr_api_linker_script)
52
53LOCAL_CFLAGS += -DGL_GLEXT_PROTOTYPES
54LOCAL_CFLAGS += -DEGL_EGLEXT_PROTOTYPES
55LOCAL_LDFLAGS += -Wl,-version-script,$(gvr_api_linker_script)
56
57LOCAL_SHARED_LIBRARIES := \
58 libandroid_runtime \
59 libbase \
60 libbinder \
61 libcutils \
62 libutils \
63 libgui \
64 libui \
65 libEGL \
66 libGLESv2 \
67 libvulkan \
68 libhardware \
69 liblog \
70 libsync \
71 libevent \
72 libprotobuf-cpp-full
73
74LOCAL_STATIC_LIBRARIES := \
75 libdisplay \
76 libbufferhub \
77 libbufferhubqueue \
78 libchrome \
79 libdvrcommon \
80 libeds \
81 libdvrgraphics \
82 libsensor \
83 libperformance \
84 libpdx_default_transport \
85
86include $(BUILD_SHARED_LIBRARY)
87
88# Prebuilt shared library for libgvr_audio.so
89include $(CLEAR_VARS)
90LOCAL_MODULE := libgvr_audio
91LOCAL_MODULE_CLASS := SHARED_LIBRARIES
92LOCAL_MODULE_SUFFIX := .so
93LOCAL_MULTILIB := both
Jiwen 'Steve' Cai123ff892017-01-28 20:44:35 -080094LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080095LOCAL_SRC_FILES_arm := prebuilt/lib/android_arm/libgvr_audio.so
96LOCAL_SRC_FILES_arm64 := prebuilt/lib/android_arm64/libgvr_audio.so
Jiwen 'Steve' Cai123ff892017-01-28 20:44:35 -080097LOCAL_SRC_FILES_x86 := prebuilt/lib/android_x86/libgvr_audio.so
98LOCAL_SRC_FILES_x86_64 := prebuilt/lib/android_x86_64/libgvr_audio.so
Alex Vakulenkoe4eec202017-01-27 14:41:04 -080099include $(BUILD_PREBUILT)
100
101# Prebuilt shared library for libgvr.so
102include $(CLEAR_VARS)
103LOCAL_MODULE := libgvr
104LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/prebuilt/include
105LOCAL_MODULE_CLASS := SHARED_LIBRARIES
106LOCAL_MODULE_SUFFIX := .so
107LOCAL_MULTILIB := both
Jiwen 'Steve' Cai123ff892017-01-28 20:44:35 -0800108LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64
Alex Vakulenkoe4eec202017-01-27 14:41:04 -0800109LOCAL_SRC_FILES_arm := prebuilt/lib/android_arm/libgvr.so
110LOCAL_SRC_FILES_arm64 := prebuilt/lib/android_arm64/libgvr.so
Jiwen 'Steve' Cai123ff892017-01-28 20:44:35 -0800111LOCAL_SRC_FILES_x86 := prebuilt/lib/android_x86/libgvr.so
112LOCAL_SRC_FILES_x86_64 := prebuilt/lib/android_x86_64/libgvr.so
Alex Vakulenkoe4eec202017-01-27 14:41:04 -0800113include $(BUILD_PREBUILT)
114
115# Prebuilt Java static library for common_library.aar
116include $(CLEAR_VARS)
117LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
118 gvr_common_library_aar:prebuilt/lib/common_library.aar
119include $(BUILD_MULTI_PREBUILT)
120
121# Dummy libgvr_ext to be used along side libgvr.so prebuilt.
122# This shall be replaced with Google3 prebuilts in future.
123include $(CLEAR_VARS)
124LOCAL_MODULE := libgvr_ext
125LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
126LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
127LOCAL_SRC_FILES := dummy_gvr_ext.cpp
128LOCAL_STATIC_LIBRARIES := libchrome
129LOCAL_LDLIBS := -llog
130LOCAL_MODULE_TAGS := optional
131LOCAL_SHARED_LIBRARIES += libgvr
132include $(BUILD_STATIC_LIBRARY)