Introduce GN variables for Vulkan repos.
This will allow them to be seamlessly overrideen in other repos.
Bug: angleproject:5390
Change-Id: I973cae48b5683e39ea3b07898b95956511260319
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2591107
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 2589ee3..9b4e382 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -402,7 +402,7 @@
if (!is_chromeos && angle_has_build) {
sources += libangle_gpu_info_util_vulkan_sources
- deps += [ "$angle_root/third_party/vulkan-headers/src:vulkan_headers" ]
+ deps += [ "$angle_vulkan_headers_dir:vulkan_headers" ]
}
if (is_android) {
diff --git a/build_overrides/vulkan_loader.gni b/build_overrides/vulkan_loader.gni
index 580eda1..63e62e9 100644
--- a/build_overrides/vulkan_loader.gni
+++ b/build_overrides/vulkan_loader.gni
@@ -4,7 +4,7 @@
import("//gni/angle.gni")
-vulkan_headers_dir = "//third_party/vulkan-headers/src"
+vulkan_headers_dir = angle_vulkan_headers_dir
vulkan_gen_subdir = "angle/vulkan"
vulkan_loader_shared = angle_shared_libvulkan
diff --git a/build_overrides/vulkan_tools.gni b/build_overrides/vulkan_tools.gni
index 4691eae..e862d3f 100644
--- a/build_overrides/vulkan_tools.gni
+++ b/build_overrides/vulkan_tools.gni
@@ -4,7 +4,7 @@
import("//gni/angle.gni")
-vulkan_headers_dir = "//third_party/vulkan-headers/src"
+vulkan_headers_dir = angle_vulkan_headers_dir
vulkan_data_subdir = angle_data_dir
vulkan_gen_subdir = "angle/vulkan"
diff --git a/build_overrides/vulkan_validation_layers.gni b/build_overrides/vulkan_validation_layers.gni
index 5d691b9..ce7070b 100644
--- a/build_overrides/vulkan_validation_layers.gni
+++ b/build_overrides/vulkan_validation_layers.gni
@@ -4,7 +4,7 @@
import("//gni/angle.gni")
-vulkan_headers_dir = "//third_party/vulkan-headers/src"
+vulkan_headers_dir = angle_vulkan_headers_dir
vvl_spirv_tools_dir = "//third_party/spirv-tools/src"
vvl_glslang_dir = "//third_party/glslang/src"
diff --git a/gni/angle.gni b/gni/angle.gni
index 1c871e3..72bdeb4 100644
--- a/gni/angle.gni
+++ b/gni/angle.gni
@@ -151,6 +151,12 @@
angle_enable_eagl = angle_enable_gl && is_ios &&
!(target_environment == "catalyst" &&
(target_cpu == "x86" || target_cpu == "x64"))
+
+ angle_vulkan_headers_dir = "$angle_root/third_party/vulkan-headers/src"
+ angle_vulkan_loader_dir = "$angle_root/third_party/vulkan-loader/src"
+ angle_vulkan_tools_dir = "$angle_root/third_party/vulkan-tools/src"
+ angle_vulkan_validation_layers_dir =
+ "$angle_root/third_party/vulkan-validation-layers/src"
}
declare_args() {
diff --git a/src/common/vulkan/BUILD.gn b/src/common/vulkan/BUILD.gn
index c32c47b..5207424 100644
--- a/src/common/vulkan/BUILD.gn
+++ b/src/common/vulkan/BUILD.gn
@@ -28,8 +28,7 @@
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_deps = [ "$angle_vulkan_headers_dir:vulkan_headers" ]
}
public_configs = [ ":angle_vulkan_headers_config" ]
}
@@ -45,9 +44,9 @@
]
} else if (!is_android && !is_ggp) {
if (angle_shared_libvulkan) {
- data_deps = [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
+ data_deps = [ "$angle_vulkan_loader_dir:libvulkan" ]
} else {
- deps = [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
+ deps = [ "$angle_vulkan_loader_dir:libvulkan" ]
}
}
}
@@ -75,11 +74,11 @@
if (!is_android && !is_fuchsia && !is_ggp) {
if (angle_shared_libvulkan) {
- data_deps += [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
+ data_deps += [ "$angle_vulkan_loader_dir:libvulkan" ]
} else {
- deps += [ "$angle_root/third_party/vulkan-loader/src:libvulkan" ]
+ deps += [ "$angle_vulkan_loader_dir:libvulkan" ]
}
- data_deps += [ "$angle_root/third_party/vulkan-tools/src:VkICD_mock_icd" ]
+ data_deps += [ "$angle_vulkan_tools_dir:VkICD_mock_icd" ]
}
if (angle_enable_swiftshader) {
@@ -104,9 +103,11 @@
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" ]
+ data_deps +=
+ [ "$angle_vulkan_validation_layers_dir:vulkan_validation_layers" ]
if (!is_android) {
- data_deps += [ "$angle_root/third_party/vulkan-validation-layers/src:vulkan_gen_json_files" ]
+ data_deps +=
+ [ "$angle_vulkan_validation_layers_dir:vulkan_gen_json_files" ]
}
}
}
diff --git a/src/third_party/volk/BUILD.gn b/src/third_party/volk/BUILD.gn
index 33b3ed6..1481ad4 100644
--- a/src/third_party/volk/BUILD.gn
+++ b/src/third_party/volk/BUILD.gn
@@ -15,5 +15,5 @@
]
public_configs = [ ":volk_config" ]
configs += [ "$angle_root:angle_no_cfi_icall" ]
- public_deps = [ "../../../third_party/vulkan-headers/src:vulkan_headers" ]
+ public_deps = [ "$angle_vulkan_headers_dir:vulkan_headers" ]
}