Skip to content

Commit

Permalink
build: Add layer settings library for Android build
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lunarg committed Aug 16, 2023
1 parent b1ffedf commit 2677940
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
28 changes: 25 additions & 3 deletions build-android/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ LAYER_DIR := ../generated
THIRD_PARTY := ../third_party

VULKAN_INCLUDE := $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Headers/include
VULKAN_UTIL_INCLUDE := $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Utility-Libraries/include

include $(CLEAR_VARS)
LOCAL_MODULE := VulkanLayerSettings

LOCAL_SRC_FILES += $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Utility-Libraries/src/layer/layer_settings_manager.cpp
LOCAL_SRC_FILES += $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Utility-Libraries/src/layer/layer_settings_util.cpp
LOCAL_SRC_FILES += $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Utility-Libraries/src/layer/vk_layer_settings.cpp

LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
$(VULKAN_UTIL_INCLUDE)
LOCAL_CPPFLAGS += -std=c++17 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -fexceptions
LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden
LOCAL_CPPFLAGS += -isystem $(VULKAN_INCLUDE)
LOCAL_CPPFLAGS += -isystem $(VULKAN_UTIL_INCLUDE)
include $(BUILD_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := extlayer_utils
Expand All @@ -40,10 +56,12 @@ include $(CLEAR_VARS)
LOCAL_MODULE := VkLayer_khronos_synchronization2
LOCAL_SRC_FILES += $(SRC_DIR)/layers/synchronization2.cpp
LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
$(VULKAN_UTIL_INCLUDE) \
$(LOCAL_PATH)/$(SRC_DIR)/utils \
$(LOCAL_PATH)/$(SRC_DIR)/utils/generated \
$(LOCAL_PATH)/$(THIRD_PARTY)/shaderc/third_party/spirv-tools/external/spirv-headers/include
LOCAL_STATIC_LIBRARIES += extlayer_utils glslang SPIRV-Tools SPIRV-Tools-opt

LOCAL_STATIC_LIBRARIES += extlayer_utils glslang SPIRV-Tools SPIRV-Tools-opt VulkanLayerSettings
LOCAL_CPPFLAGS += -std=c++17 -fexceptions
LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -fvisibility=hidden
LOCAL_LDLIBS := -llog -landroid
Expand All @@ -55,11 +73,13 @@ include $(CLEAR_VARS)
LOCAL_MODULE := VkLayer_khronos_memory_decompression
LOCAL_SRC_FILES += $(SRC_DIR)/layers/decompression/decompression.cpp
LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
$(VULKAN_UTIL_INCLUDE) \
$(LOCAL_PATH)/$(SRC_DIR)/layers \
$(LOCAL_PATH)/$(SRC_DIR)/utils \
$(LOCAL_PATH)/$(SRC_DIR)/utils/generated \
$(LOCAL_PATH)/$(THIRD_PARTY)/shaderc/third_party/spirv-tools/external/spirv-headers/include
LOCAL_STATIC_LIBRARIES += extlayer_utils glslang SPIRV-Tools SPIRV-Tools-opt

LOCAL_STATIC_LIBRARIES += extlayer_utils glslang SPIRV-Tools SPIRV-Tools-opt VulkanLayerSettings
LOCAL_CPPFLAGS += -std=c++17 -fexceptions
LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -fvisibility=hidden
LOCAL_LDLIBS := -llog -landroid
Expand All @@ -71,7 +91,9 @@ include $(CLEAR_VARS)
LOCAL_MODULE := VkLayer_khronos_timeline_semaphore
LOCAL_SRC_FILES += $(SRC_DIR)/layers/timeline_semaphore.c \
$(SRC_DIR)/layers/hash_table.cpp
LOCAL_C_INCLUDES += $(VULKAN_INCLUDE)

LOCAL_C_INCLUDES += $(VULKAN_INCLUDE) \
$(VULKAN_UTIL_INCLUDE)
LOCAL_CPPFLAGS += -std=c++17 -fexceptions
LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -fvisibility=hidden
LOCAL_LDLIBS := -llog -landroid
Expand Down
15 changes: 15 additions & 0 deletions build-android/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
"install_dir": "Vulkan-Headers/build/install",
"commit": "v1.3.261"
},
{
"name": "Vulkan-Utility-Libraries",
"url": "https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git",
"sub_dir": "Vulkan-Utility-Libraries",
"build_dir": "Vulkan-Utility-Libraries/build",
"install_dir": "Vulkan-Utility-Libraries/build/install",
"commit": "c0525368d724896349b40d8aa7b779f32bbbed0c",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
"repo_name": "Vulkan-Headers"
}
]
},
{
"name": "glslang",
"url": "https://github.com/KhronosGroup/glslang.git",
Expand All @@ -30,6 +44,7 @@
],
"install_names": {
"Vulkan-Headers": "VULKAN_HEADERS_INSTALL_DIR",
"Vulkan-Utility-Libraries": "VULKAN_UTILITY_LIBRARIES_INSTALL_DIR",
"glslang": "GLSLANG_INSTALL_DIR",
"SPIRV-Headers": "SPIRV_HEADERS_INSTALL_DIR"
}
Expand Down

0 comments on commit 2677940

Please sign in to comment.