1# Copyright (C) 2018-2019 The ANGLE Project Authors. 2# Copyright (C) 2019-2023 LunarG, Inc. 3# Copyright (c) 2023-2024 Huawei Device Co., Ltd. 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# https://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16import("//build/ohos.gni") 17 18# Vulkan loader build options 19 20## Build libvulkan.so {{{ 21 22config("vulkan_internal_config") { 23 defines = [ "VK_ENABLE_BETA_EXTENSIONS" ] 24 cflags = [ 25 "-Wno-conversion", 26 "-Wno-extra-semi", 27 "-Wno-sign-compare", 28 "-Wno-unreachable-code", 29 "-Wno-unused-function", 30 "-Wno-unused-variable", 31 "-fPIC", 32 ] 33 ldflags = [ "-Wl,-Bsymbolic" ] 34 35 defines += [ 36 "SYSCONFDIR=\"/system/etc:/vendor/etc\"", 37 "VK_USE_PLATFORM_OHOS", 38 ] 39} 40 41config("vulkan_loader_config") { 42 include_dirs = [ 43 "loader/generated", 44 "loader", 45 "openharmony", 46 ] 47 defines = [ "LOADER_USE_UNSAFE_FILE_SEARCH=1" ] 48} 49 50ohos_shared_library("vulkan_loader") { 51 sources = [ 52 "loader/adapters.h", 53 "loader/allocation.c", 54 "loader/allocation.h", 55 "loader/cJSON.c", 56 "loader/cJSON.h", 57 "loader/debug_utils.c", 58 "loader/debug_utils.h", 59 "loader/dev_ext_trampoline.c", 60 "loader/extension_manual.c", 61 "loader/extension_manual.h", 62 "loader/generated/vk_layer_dispatch_table.h", 63 "loader/generated/vk_loader_extensions.h", 64 "loader/generated/vk_object_types.h", 65 "loader/gpa_helper.c", 66 "loader/gpa_helper.h", 67 "loader/loader.c", 68 "loader/loader.h", 69 "loader/loader_common.h", 70 "loader/loader_environment.c", 71 "loader/loader_environment.h", 72 "loader/log.c", 73 "loader/log.h", 74 "loader/phys_dev_ext.c", 75 "loader/settings.c", 76 "loader/settings.h", 77 "loader/stack_allocation.h", 78 "loader/terminator.c", 79 "loader/trampoline.c", 80 "loader/unknown_function_handling.c", 81 "loader/unknown_function_handling.h", 82 "loader/vk_loader_layer.h", 83 84 # TODO(jmadill): Use assembler where available. 85 "loader/unknown_ext_chain.c", 86 "loader/vk_loader_platform.h", 87 "loader/wsi.c", 88 "loader/wsi.h", 89 ] 90 91 configs = [ ":vulkan_internal_config" ] 92 public_configs = [ ":vulkan_loader_config" ] 93 external_deps = [ 94 "hilog:libhilog", 95 "init:libbegetutil", 96 ] 97 public_external_deps = [ "vulkan-headers:vulkan_headers" ] 98 99 output_name = "vulkan" 100 output_extension = "so" 101 102 part_name = "vulkan-loader" 103 subsystem_name = "thirdparty" 104 105 license_file = "//third_party/vulkan-loader/LICENSE.txt" 106} 107## Build libvulkan.so }}} 108