1# Copyright 2018-2023 The ANGLE Project Authors.
2# Copyright 2019-2023 LunarG, Inc.
3#
4# SPDX-License-Identifier: Apache-2.0
5
6import("//build/ohos.gni")
7
8is_ohos = current_os == "ohos"
9is_android = current_os == "android"
10is_mac = current_os == "ios" || current_os == "tvos" || current_os == "mac"
11is_win = current_os == "win" || current_os == "mingw"
12is_fuchsia = current_os == "fuchsia"
13is_apple = current_os == "apple"
14
15config("vulkan_headers_config") {
16  include_dirs = [ "include" ]
17  defines = []
18
19  if (is_ohos) {
20    defines += [ "VK_USE_PLATFORM_OHOS" ]
21  }
22
23  if (is_win) {
24    defines += [ "VK_USE_PLATFORM_WIN32_KHR" ]
25  }
26  if (defined(vulkan_use_x11) && vulkan_use_x11) {
27    defines += [ "VK_USE_PLATFORM_XCB_KHR" ]
28  }
29  if (defined(vulkan_use_wayland) && vulkan_use_wayland) {
30    defines += [ "VK_USE_PLATFORM_WAYLAND_KHR" ]
31    if (defined(vulkan_wayland_include_dirs)) {
32      include_dirs += vulkan_wayland_include_dirs
33    }
34  }
35  if (is_android) {
36    defines += [ "VK_USE_PLATFORM_ANDROID_KHR" ]
37  }
38  if (is_fuchsia) {
39    defines += [ "VK_USE_PLATFORM_FUCHSIA" ]
40  }
41  if (is_apple) {
42    defines += [ "VK_USE_PLATFORM_METAL_EXT" ]
43  }
44  if (is_mac) {
45    defines += [ "VK_USE_PLATFORM_MACOS_MVK" ]
46  }
47  if (is_ios) {
48    defines += [ "VK_USE_PLATFORM_IOS_MVK" ]
49  }
50  if (defined(is_ggp) && is_ggp) {
51    defines += [ "VK_USE_PLATFORM_GGP" ]
52  }
53  if (is_clang) {
54    cflags = [ "-Wno-redundant-parens" ]
55  }
56}
57
58# Vulkan headers only, no compiled sources.
59ohos_static_library("vulkan_headers") {
60  sources = [
61    "include/vk_video/vulkan_video_codec_h264std.h",
62    "include/vk_video/vulkan_video_codec_h264std_decode.h",
63    "include/vk_video/vulkan_video_codec_h264std_encode.h",
64    "include/vk_video/vulkan_video_codec_h265std.h",
65    "include/vk_video/vulkan_video_codec_h265std_decode.h",
66    "include/vk_video/vulkan_video_codec_h265std_encode.h",
67    "include/vk_video/vulkan_video_codecs_common.h",
68    "include/vulkan/vk_icd.h",
69    "include/vulkan/vk_layer.h",
70    "include/vulkan/vk_platform.h",
71    "include/vulkan/vulkan.h",
72    "include/vulkan/vulkan.hpp",
73    "include/vulkan/vulkan_core.h",
74    "include/vulkan/vulkan_ohos.h",
75    "include/vulkan/vulkan_screen.h",
76  ]
77  public_configs = [ ":vulkan_headers_config" ]
78
79  license_file = "//third_party/vulkan-headers/LICENSES/Apache-2.0.txt"
80}
81