1# Copyright (C) 2018-2019 The ANGLE Project Authors. 2# Copyright (C) 2019 LunarG, Inc. 3# Copyright (c) 2022 Huawei Device Co., Ltd. 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# https://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17import("//build/ohos.gni") 18 19is_ohos = current_os == "ohos" 20is_android = current_os == "android" 21is_mac = current_os == "ios" || current_os == "tvos" || current_os == "mac" 22is_win = current_os == "win" || current_os == "mingw" 23is_linux = current_os == "linux" 24is_fuchsia = current_os == "fuchsia" 25 26config("vulkan_headers_config") { 27 include_dirs = [ "include" ] 28 29 if (is_ohos) { 30 defines = [ "VK_USE_PLATFORM_OHOS_OPENHARMONY" ] 31 } 32 if (is_win) { 33 defines = [ "VK_USE_PLATFORM_WIN32_KHR" ] 34 } 35 if (is_linux) { 36 if (defined(vulkan_use_x11) && vulkan_use_x11) { 37 defines = [ "VK_USE_PLATFORM_XCB_KHR" ] 38 } 39 } 40 if (is_android) { 41 defines = [ "VK_USE_PLATFORM_ANDROID_KHR" ] 42 } 43 if (is_fuchsia) { 44 defines = [ "VK_USE_PLATFORM_FUCHSIA" ] 45 } 46 if (is_mac) { 47 defines = [ "VK_USE_PLATFORM_METAL_EXT" ] 48 } 49 if (defined(is_ggp) && is_ggp) { 50 defines = [ "VK_USE_PLATFORM_GGP" ] 51 } 52} 53 54# Vulkan headers only, no compiled sources. 55source_set("vulkan_headers") { 56 sources = [ 57 "include/vulkan/vk_icd.h", 58 "include/vulkan/vk_layer.h", 59 "include/vulkan/vk_platform.h", 60 "include/vulkan/vk_sdk_platform.h", 61 "include/vulkan/vulkan.h", 62 "include/vulkan/vulkan.hpp", 63 "include/vulkan/vulkan_core.h", 64 "include/vulkan/vulkan_ohos.h", 65 ] 66 public_configs = [ ":vulkan_headers_config" ] 67} 68