1# Copyright (c) 2021 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") 14 15## Build libvulkan.so {{{ 16config("vulkan_config") { 17 visibility = [ ":*" ] 18 19 defines = [ 20 "VK_USE_PLATFORM_OHOS_OPENHARMONY", 21 "VK_NO_PROTOTYPES", 22 ] 23 24 cflags = [ 25 "-fvisibility=hidden", 26 "-Wall", 27 "-Werror", 28 "-g3", 29 ] 30} 31 32config("vulkan_public_config") { 33 include_dirs = [ 34 "include", 35 "//drivers/peripheral/base", 36 "//foundation/graphic/graphic_2d/frameworks/surface/include", 37 "//foundation/graphic/graphic_2d/frameworks/inner_api/surface", 38 ] 39} 40 41ohos_shared_library("vulkan") { 42 sources = [ 43 "src/api_export.cpp", 44 "src/driver.cpp", 45 "src/driver_loader.cpp", 46 "src/swapchain.cpp", 47 ] 48 configs = [ ":vulkan_config" ] 49 50 public_configs = [ ":vulkan_public_config" ] 51 52 public_deps = [ 53 "//foundation/graphic/graphic_2d/frameworks/surface:surface", 54 "//third_party/vulkan-headers:vulkan_headers", 55 ] 56 57 external_deps = [ 58 "c_utils:utils", 59 "hilog_native:libhilog", 60 ] 61 62 output_name = "vulkan" 63 output_extension = "so" 64 65 part_name = "graphic_standard" 66 subsystem_name = "graphic" 67 license_file = "//third_party/vulkan-headers/LICENSE.txt" 68} 69 70## Build libvulkan.so }}} 71 72## Build vulkan_wrapper_native_test {{{ 73ohos_executable("vulkan_wrapper_native_test") { 74 install_enable = true 75 76 sources = [ "test/vulkan_wrapper_native_test.cpp" ] 77 78 include_dirs = [ "include" ] 79 80 defines = [ 81 "VK_USE_PLATFORM_OHOS_OPENHARMONY", 82 "VK_NO_PROTOTYPES", 83 ] 84 85 external_deps = [ "c_utils:utils" ] 86 87 deps = [ "//third_party/vulkan-headers:vulkan_headers" ] 88 89 part_name = "graphic_standard" 90 subsystem_name = "graphic" 91} 92## Build vulkan_wrapper_native_test }}} 93