1# Copyright (C) 2018-2019 The ANGLE Project Authors. 2# Copyright (C) 2019 LunarG, Inc. 3# 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 18is_ohos = current_os == "ohos" 19is_android = current_os == "android" 20is_mac = current_os == "ios" || current_os == "tvos" || current_os == "mac" 21is_win = current_os == "win" || current_os == "mingw" 22is_linux = current_os == "linux" 23is_fuchsia = current_os == "fuchsia" 24 25config("vulkan_headers_config") { 26 include_dirs = [ "include" ] 27 defines = [] 28 29 if (is_ohos) { 30 defines += [ "VK_USE_PLATFORM_OHOS" ] 31 } 32 33 if (is_win) { 34 defines += [ "VK_USE_PLATFORM_WIN32_KHR" ] 35 } 36 if (is_linux) { 37 if (defined(vulkan_use_x11) && vulkan_use_x11) { 38 defines += [ "VK_USE_PLATFORM_XCB_KHR" ] 39 } 40 } 41 if (defined(vulkan_use_wayland) && vulkan_use_wayland) { 42 defines += [ "VK_USE_PLATFORM_WAYLAND_KHR" ] 43 if (defined(vulkan_wayland_include_dirs)) { 44 include_dirs += vulkan_wayland_include_dirs 45 } 46 } 47 if (is_android) { 48 defines += [ "VK_USE_PLATFORM_ANDROID_KHR" ] 49 } 50 if (is_fuchsia) { 51 defines += [ "VK_USE_PLATFORM_FUCHSIA" ] 52 } 53 if (is_mac) { 54 defines += [ "VK_USE_PLATFORM_METAL_EXT" ] 55 } 56 if (defined(is_ggp) && is_ggp) { 57 defines += [ "VK_USE_PLATFORM_GGP" ] 58 } 59} 60 61# Vulkan headers only, no compiled sources. 62source_set("vulkan_headers") { 63 sources = [ 64 "include/vulkan/vk_icd.h", 65 "include/vulkan/vk_layer.h", 66 "include/vulkan/vk_platform.h", 67 "include/vulkan/vk_sdk_platform.h", 68 "include/vulkan/vulkan.h", 69 "include/vulkan/vulkan.hpp", 70 "include/vulkan/vulkan_core.h", 71 "include/vulkan/vulkan_ohos.h", 72 ] 73 public_configs = [ ":vulkan_headers_config" ] 74} 75