• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
18group("vulkan_loader_test") {
19  testonly = true
20
21  public_deps = [ "openharmony/test:test" ]
22}
23
24# Vulkan loader build options
25
26## Build libvulkan.so {{{
27
28config("vulkan_internal_config") {
29  defines = [ "VK_ENABLE_BETA_EXTENSIONS" ]
30  cflags = [
31    "-Wno-conversion",
32    "-Wno-extra-semi",
33    "-Wno-sign-compare",
34    "-Wno-unreachable-code",
35    "-Wno-unused-function",
36    "-Wno-unused-variable",
37    "-fPIC",
38  ]
39  cflags_cc = [ "-std=c++17" ]
40  ldflags = [ "-Wl,-Bsymbolic" ]
41
42  defines += [
43    "SYSCONFDIR=\"/system/etc:/vendor/etc\"",
44    "VK_USE_PLATFORM_OHOS",
45  ]
46}
47
48config("vulkan_loader_config") {
49  include_dirs = [
50    "loader/generated",
51    "loader",
52    "openharmony",
53  ]
54  defines = [ "LOADER_USE_UNSAFE_FILE_SEARCH=1" ]
55}
56
57ohos_shared_library("vulkan_loader") {
58  branch_protector_ret = "pac_ret"
59  sources = [
60    "loader/adapters.h",
61    "loader/allocation.c",
62    "loader/allocation.h",
63    "loader/cJSON.c",
64    "loader/cJSON.h",
65    "loader/debug_utils.c",
66    "loader/debug_utils.h",
67    "loader/dev_ext_trampoline.c",
68    "loader/extension_manual.c",
69    "loader/extension_manual.h",
70    "loader/generated/vk_layer_dispatch_table.h",
71    "loader/generated/vk_loader_extensions.h",
72    "loader/generated/vk_object_types.h",
73    "loader/gpa_helper.c",
74    "loader/gpa_helper.h",
75    "loader/loader.c",
76    "loader/loader.h",
77    "loader/loader_common.h",
78    "loader/loader_environment.c",
79    "loader/loader_environment.h",
80    "loader/log.c",
81    "loader/log.h",
82    "loader/phys_dev_ext.c",
83    "loader/settings.c",
84    "loader/settings.h",
85    "loader/stack_allocation.h",
86    "loader/terminator.c",
87    "loader/trampoline.c",
88    "loader/unknown_function_handling.c",
89    "loader/unknown_function_handling.h",
90    "loader/vk_loader_layer.h",
91
92    # TODO(jmadill): Use assembler where available.
93    "loader/unknown_ext_chain.c",
94    "loader/vk_loader_platform.h",
95    "loader/wsi.c",
96    "loader/wsi.h",
97    "openharmony/bundle_mgr_helper/vk_bundle_mgr_helper.cpp",
98    "openharmony/bundle_mgr_helper/vk_bundle_mgr_helper.h",
99    "openharmony/loader_hilog.h",
100  ]
101
102  configs = [ ":vulkan_internal_config" ]
103  public_configs = [ ":vulkan_loader_config" ]
104  external_deps = [
105    "bundle_framework:appexecfwk_base",
106    "bundle_framework:appexecfwk_core",
107    "c_utils:utils",
108    "hilog:libhilog",
109    "init:libbegetutil",
110    "ipc:ipc_core",
111    "samgr:samgr_proxy",
112  ]
113  public_external_deps = [ "vulkan-headers:vulkan_headers" ]
114
115  output_name = "vulkan"
116  output_extension = "so"
117
118  part_name = "vulkan-loader"
119  subsystem_name = "thirdparty"
120
121  license_file = "//third_party/vulkan-loader/LICENSE.txt"
122}
123## Build libvulkan.so }}}
124