Hash :
fac68170
Author :
Date :
2020-07-08T22:19:43
Don't build vulkan_validation_layers on macOS. angle_enable_vulkan_validation_layers is false on is_mac, so it looks like they were built by accident. Guard the dep on $angle_root/src/common/vulkan:vulkan_validation_layers by angle_enable_vulkan_validation_layers instead of angle_enable_vulkan, and only define the target if angle_enable_vulkan_validation_layers is true (because src/common/vulkan/BUILD.gn gets loaded due to deps on other targets in it, and when a .gn file is loaded all the targets in it get defined). Since vulkan_validation_layers doesn't currently build on arm macs, this happens to fix a build problem there, but it also makes the build on intel macs a bit smaller. This sidesteps comment 13 on the bug. If we ever want to use the validation layers on mac, we'll have to do a real fix then. Bug: chromium:1098741 Change-Id: I8164ff13de98d34ed875c6e6d0550eae64b2d0dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2289042 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
# Copyright 2020 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build_overrides/swiftshader.gni")
import("../../../gni/angle.gni")
assert(angle_enable_vulkan)
config("angle_vulkan_lib_android") {
if (is_android) {
libs = [ "vulkan" ]
}
}
config("angle_vulkan_headers_config") {
if (angle_shared_libvulkan) {
defines = [ "ANGLE_SHARED_LIBVULKAN=1" ]
}
}
angle_source_set("angle_vulkan_headers") {
sources = [
"vk_ext_provoking_vertex.h",
"vk_google_filtering_precision.h",
"vk_headers.h",
]
if (angle_shared_libvulkan) {
public_deps = [ "$angle_root/src/third_party/volk:volk" ]
} else {
public_deps =
[ "$angle_root/third_party/vulkan-headers/src:vulkan_headers" ]
}
public_configs = [ ":angle_vulkan_headers_config" ]
}
group("angle_vulkan_entry_points") {
public_configs = [ ":angle_vulkan_lib_android" ]
public_deps = [ ":angle_vulkan_headers" ]
if (is_fuchsia) {
public_deps += [
"$angle_root/src/common/fuchsia_egl",
"//third_party/fuchsia-sdk:vulkan_base",
"//third_party/fuchsia-sdk/sdk/pkg/vulkan",
]
} else if (!is_android && !is_ggp) {
if (angle_shared_libvulkan) {
data_deps = [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
} else {
deps = [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
}
}
}
angle_source_set("vulkan") {
sources = [
"vulkan_icd.cpp",
"vulkan_icd.h",
]
public_deps = [
":angle_vulkan_entry_points",
"$angle_root:angle_common",
]
defines = [
"ANGLE_VK_LAYERS_DIR=\"$angle_data_dir\"",
"ANGLE_VK_MOCK_ICD_JSON=\"$angle_data_dir/VkICD_mock_icd.json\"",
]
deps = []
data_deps = []
if (!is_android && !is_fuchsia && !is_ggp) {
if (angle_shared_libvulkan) {
data_deps += [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
} else {
deps += [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
}
data_deps += [ "$angle_root/third_party/vulkan-tools/src:VkICD_mock_icd" ]
}
if (angle_enable_swiftshader) {
import("$swiftshader_dir/src/Vulkan/vulkan.gni")
_sws_icd = "./$swiftshader_icd_file_name"
if (is_win) {
_sws_icd = ".\\\\$swiftshader_icd_file_name"
}
defines += [ "ANGLE_VK_SWIFTSHADER_ICD_JSON=\"${_sws_icd}\"" ]
data_deps += [
"$swiftshader_dir/src/Vulkan:icd_file",
"$swiftshader_dir/src/Vulkan:swiftshader_libvulkan",
]
}
}
if (angle_enable_vulkan_validation_layers) {
group("vulkan_validation_layers") {
data_deps = []
if (is_fuchsia) {
data_deps += [ "//third_party/fuchsia-sdk:vulkan_validation" ]
} else {
data_deps += [ "$angle_root/third_party/vulkan-validation-layers/src:vulkan_validation_layers" ]
if (!is_android) {
data_deps += [ "$angle_root/third_party/vulkan-validation-layers/src:vulkan_gen_json_files" ]
}
}
}
}