# Copyright (c) 2021 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") ## Build libvulkan.so {{{ config("vulkan_config") { visibility = [ ":*" ] defines = [ "VK_USE_PLATFORM_OHOS_OPENHARMONY", "VK_NO_PROTOTYPES", ] cflags = [ "-fvisibility=hidden", "-Wall", "-Werror", "-g3", ] } config("vulkan_public_config") { include_dirs = [ "include", "//drivers/peripheral/base", "//foundation/graphic/graphic_2d/frameworks/surface/include", "//foundation/graphic/graphic_2d/frameworks/inner_api/surface", ] } ohos_shared_library("vulkan") { sources = [ "src/api_export.cpp", "src/driver.cpp", "src/driver_loader.cpp", "src/swapchain.cpp", ] configs = [ ":vulkan_config" ] public_configs = [ ":vulkan_public_config" ] public_deps = [ "//foundation/graphic/graphic_2d/frameworks/surface:surface", "//third_party/vulkan-headers:vulkan_headers", ] external_deps = [ "c_utils:utils", "hilog_native:libhilog", ] output_name = "vulkan" output_extension = "so" part_name = "graphic_standard" subsystem_name = "graphic" license_file = "//third_party/vulkan-headers/LICENSE.txt" } ## Build libvulkan.so }}} ## Build vulkan_wrapper_native_test {{{ ohos_executable("vulkan_wrapper_native_test") { install_enable = true sources = [ "test/vulkan_wrapper_native_test.cpp" ] include_dirs = [ "include" ] defines = [ "VK_USE_PLATFORM_OHOS_OPENHARMONY", "VK_NO_PROTOTYPES", ] external_deps = [ "c_utils:utils" ] deps = [ "//third_party/vulkan-headers:vulkan_headers" ] part_name = "graphic_standard" subsystem_name = "graphic" } ## Build vulkan_wrapper_native_test }}}