1# Copyright 2015 The Android Open Source Project
2# Copyright (C) 2015 Valve Corporation
3
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7
8#      http://www.apache.org/licenses/LICENSE-2.0
9
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16LOCAL_PATH := $(call my-dir)
17SRC_DIR := ../..
18LAYER_DIR := ../generated
19THIRD_PARTY := ../third_party
20
21VULKAN_INCLUDE := $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Headers/include
22
23include $(CLEAR_VARS)
24LOCAL_MODULE := extlayer_utils
25
26LOCAL_SRC_FILES += $(SRC_DIR)/utils/allocator.cpp
27LOCAL_SRC_FILES += $(SRC_DIR)/utils/vk_format_utils.cpp
28LOCAL_SRC_FILES += $(SRC_DIR)/utils/vk_layer_config.cpp
29LOCAL_SRC_FILES += $(SRC_DIR)/utils/generated/vk_safe_struct.cpp
30LOCAL_SRC_FILES += $(SRC_DIR)/utils/generated/lvt_function_pointers.cpp
31
32LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
33                    $(LOCAL_PATH)/$(SRC_DIR)/utils/generated \
34                    $(LOCAL_PATH)/$(SRC_DIR)/utils
35LOCAL_CPPFLAGS += -std=c++11 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -fexceptions
36LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden
37include $(BUILD_STATIC_LIBRARY)
38
39include $(CLEAR_VARS)
40LOCAL_MODULE := VkLayer_khronos_synchronization2
41LOCAL_SRC_FILES += $(SRC_DIR)/layers/synchronization2.cpp
42LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
43                    $(LOCAL_PATH)/$(SRC_DIR)/utils \
44                    $(LOCAL_PATH)/$(SRC_DIR)/utils/generated \
45                    $(LOCAL_PATH)/$(THIRD_PARTY)/shaderc/third_party/spirv-tools/external/spirv-headers/include
46LOCAL_STATIC_LIBRARIES += extlayer_utils glslang SPIRV-Tools SPIRV-Tools-opt
47LOCAL_CPPFLAGS += -std=c++11 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -Wno-cast-calling-convention -fexceptions
48LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden
49LOCAL_LDLIBS    := -llog -landroid
50LOCAL_LDFLAGS   += -Wl,-Bsymbolic
51LOCAL_LDFLAGS   += -Wl,--exclude-libs,ALL
52include $(BUILD_SHARED_LIBRARY)
53
54include $(CLEAR_VARS)
55LOCAL_MODULE := VkExtensionLayerTests
56LOCAL_SRC_FILES += $(SRC_DIR)/tests/extension_layer_tests.cpp \
57                   $(SRC_DIR)/tests/vktestbinding.cpp \
58                   $(SRC_DIR)/tests/synchronization2_tests.cpp \
59                   $(SRC_DIR)/tests/vkrenderframework.cpp \
60                   $(SRC_DIR)/tests/vktestframeworkandroid.cpp \
61                   $(SRC_DIR)/tests/test_environment.cpp
62LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
63                    $(LOCAL_PATH)/$(SRC_DIR)/utils/generated \
64                    $(LOCAL_PATH)/$(SRC_DIR)/utils \
65                    $(LOCAL_PATH)/$(SRC_DIR)/libs \
66                    $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Tools/common
67
68LOCAL_STATIC_LIBRARIES := googletest_main extlayer_utils shaderc
69LOCAL_CPPFLAGS += -std=c++11 -DVK_PROTOTYPES -Wall -Werror -Wno-unused-function -Wno-unused-const-variable
70LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DNV_EXTENSIONS -DAMD_EXTENSIONS -fvisibility=hidden
71LOCAL_LDLIBS := -llog -landroid -ldl
72LOCAL_LDFLAGS   += -Wl,-Bsymbolic
73LOCAL_LDFLAGS   += -Wl,--exclude-libs,ALL
74include $(BUILD_EXECUTABLE)
75
76# Note: The following module is similar in name to the executable, but differs so that loader won't enumerate the resulting .so
77include $(CLEAR_VARS)
78LOCAL_MODULE := VulkanExtensionLayerTests
79LOCAL_SRC_FILES += $(SRC_DIR)/tests/extension_layer_tests.cpp \
80                   $(SRC_DIR)/tests/vktestbinding.cpp \
81                   $(SRC_DIR)/tests/synchronization2_tests.cpp \
82                   $(SRC_DIR)/tests/vkrenderframework.cpp \
83                   $(SRC_DIR)/tests/vktestframeworkandroid.cpp \
84                   $(SRC_DIR)/tests/test_environment.cpp
85LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
86                    $(LOCAL_PATH)/$(SRC_DIR)/utils/generated \
87                    $(LOCAL_PATH)/$(SRC_DIR)/utils \
88                    $(LOCAL_PATH)/$(SRC_DIR)/libs \
89                    $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Tools/common
90
91LOCAL_STATIC_LIBRARIES := googletest_main extlayer_utils shaderc
92LOCAL_CPPFLAGS += -std=c++11 -DVK_PROTOTYPES -Wall -Werror -Wno-unused-function -Wno-unused-const-variable
93LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DNV_EXTENSIONS -DAMD_EXTENSIONS -fvisibility=hidden -DVALIDATION_APK
94LOCAL_WHOLE_STATIC_LIBRARIES += android_native_app_glue
95LOCAL_LDLIBS := -llog -landroid -ldl
96LOCAL_LDFLAGS := -u ANativeActivity_onCreate
97include $(BUILD_SHARED_LIBRARY)
98
99$(call import-module,android/native_app_glue)
100$(call import-module,third_party/googletest)
101$(call import-module,third_party/shaderc)
102