Override the SPIRV-Headers path to use local copy
SPIRV-Tools' BUILD.gn file uses the spirv_tools_spirv_headers_dir
variable to provide the path to the SPIRV-Headers project. This variable
is set by //build_overrides/spirv_tools.gni, which when building as part
of Chromium points to //third_party/vulkan-deps/spirv-headers/src. That
version can be out of sync with SwiftShader's internal copy of SPIRV-
Tools.
Instead we want it to build with our internal copy of SPIRV-Headers.
This change accomplishes that by overriding the path to be relative
to the SPIRV-Tools directory, instead of being determined by
spirv_tools_spirv_headers_dir.
This is a local workaround to unblock autorollers. We'll need a proper
fix in the upstream SPIRV-Tools repo which can then be imported.
Bug: b/158002593
Change-Id: I0a19539230bf470a9943478ac4f3a15061fe6070
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/65688
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/third_party/SPIRV-Tools/BUILD.gn b/third_party/SPIRV-Tools/BUILD.gn
index ba05497..fe1919d 100644
--- a/third_party/SPIRV-Tools/BUILD.gn
+++ b/third_party/SPIRV-Tools/BUILD.gn
@@ -30,7 +30,10 @@
spvtools_build_executables = true
}
-spirv_headers = spirv_tools_spirv_headers_dir
+# TODO(b/158002593): The line below is modified from the upstream build file to
+# override the SPIRV-Headers path with that of SwiftShader. This needs to be
+# fixed upstream so we don't need this local change.
+spirv_headers = "../SPIRV-Headers"
spirv_is_winuwp = is_win && target_os == "winuwp"
template("spvtools_core_tables") {