1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13import("//build/ohos.gni") 14import("//foundation/graphic/graphic_2d/graphic_config.gni") 15 16## Build libvulkan_swapchain.so {{{ 17config("vulkan_config") { 18 defines = [ 19 "VK_USE_PLATFORM_OHOS", 20 "VK_NO_PROTOTYPES", 21 ] 22 23 cflags = [ 24 "-fvisibility=hidden", 25 "-Wall", 26 "-Werror", 27 "-g3", 28 ] 29} 30 31config("vulkan_public_config") { 32 include_dirs = [ 33 "swapchain", 34 "include", 35 "//third_party/vulkan-loader/loader/generated", 36 "../../frameworks/surface/include", 37 ] 38} 39 40ohos_shared_library("vulkan_swapchain_layer") { 41 sources = [ "swapchain_layer/swapchain_layer.cpp" ] 42 43 configs = [ ":vulkan_config" ] 44 45 public_configs = [ ":vulkan_public_config" ] 46 47 deps = [ 48 "$graphic_2d_root:libsurface", 49 "$graphic_2d_root/utils:sync_fence", 50 "//third_party/vulkan-headers:vulkan_headers", 51 ] 52 53 external_deps = [ 54 "c_utils:utils", 55 "hilog:libhilog", 56 ] 57 58 output_name = "vulkan_swapchain" 59 output_extension = "so" 60 61 part_name = "graphic_2d" 62 subsystem_name = "graphic" 63} 64 65## Build libvulkan_swapchain.so }}} 66 67## Build VkLayer_swapchain.json {{{ 68ohos_prebuilt_etc("vulkan_swapchain_layer_json") { 69 source = "swapchain_layer/VkLayer_swapchain.json" 70 part_name = "graphic_2d" 71 subsystem_name = "graphic" 72 module_install_dir = "etc/vulkan/implicit_layer.d" 73} 74## Build VkLayer_swapchain.json }}} 75