Wrap all uses of SPIRV-Cross in #define.

Put all cross-platform code references to Spirv-Cross behind
ifdef DAWN_USE_SPIRV_CROSS. Hide build dependencies behind
dawn_use_spirv_cross, which itself is set from dawn_enable_opengl,
since it is the only backend which is still using SPIRV-Cross.

Bug: dawn:1036

Change-Id: Id61512230b50a32c63827a16fece40d7899968d8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/61400
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
Stephen White
2021-08-10 18:30:55 +00:00
committed by Dawn LUCI CQ
parent ec9b81142f
commit 5d17ed6541
7 changed files with 36 additions and 58 deletions

View File

@@ -104,5 +104,9 @@ declare_args() {
dawn_supports_glfw_for_windowing =
(is_win && !dawn_is_winuwp) || (is_linux && !is_chromeos) || is_mac
# Much of the backend code is shared, so define a convenience var.
# Much of the GL backend code is shared, so define a convenience var.
dawn_enable_opengl = dawn_enable_opengles || dawn_enable_desktop_gl
# The GL backends are the last to use SPIRV-Cross, so only compile it in
# if they are enabled.
dawn_use_spirv_cross = dawn_enable_opengl