# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//foundation/graphic/graphic_2d/graphic_config.gni") ## Build libvulkan_swapchain.so {{{ config("vulkan_config") { defines = [ "VK_USE_PLATFORM_OHOS", "VK_NO_PROTOTYPES", ] if (graphic_2d_feature_use_aps_igameservice_func) { defines += [ "USE_APS_IGAMESERVICE_FUNC=1" ] } else { defines += [ "USE_APS_IGAMESERVICE_FUNC=0" ] } cflags = [ "-fvisibility=hidden", "-Wall", "-Werror", "-g3", ] } config("vulkan_public_config") { include_dirs = [ "swapchain", "include", ] if (graphic_2d_feature_use_aps_igameservice_func) { include_dirs += gameservice_render_slice_report_include_dirs } } ohos_shared_library("vulkan_swapchain_layer") { sources = [ "swapchain_layer/swapchain_layer.cpp" ] if (graphic_2d_feature_use_aps_igameservice_func) { sources += gameservice_render_slice_report_sources } configs = [ ":vulkan_config" ] public_configs = [ ":vulkan_public_config" ] deps = [ "$graphic_2d_root/utils:scoped_bytrace" ] external_deps = [ "c_utils:utils", "graphic_surface:surface", "graphic_surface:sync_fence", "hilog:libhilog", "vulkan-headers:vulkan_headers", "vulkan-loader:vulkan_loader", ] if (graphic_2d_feature_use_aps_igameservice_func) { external_deps += gameservice_render_slice_report_external_deps } output_name = "vulkan_swapchain" output_extension = "so" part_name = "graphic_2d" subsystem_name = "graphic" } ## Build libvulkan_swapchain.so }}} ## Build VkLayer_swapchain.json {{{ ohos_prebuilt_etc("vulkan_swapchain_layer_json") { source = "swapchain_layer/VkLayer_swapchain.json" part_name = "graphic_2d" subsystem_name = "graphic" module_install_dir = "etc/vulkan/swapchain/vulkan/implicit_layer.d" } ## Build VkLayer_swapchain.json }}}