[build] Add guards for protobuf
GN: Only assume protobuf is available if tint_standalone or build_with_chromium
CMake: Add DAWN_PROTOBUF_DIR option, enable only if the directory exists
Change-Id: I8835002cb5934f20e6bf8c814199d636af0ebd27
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/161341
Commit-Queue: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/scripts/tint_overrides_with_defaults.gni b/scripts/tint_overrides_with_defaults.gni
index adecb7d..de64173 100644
--- a/scripts/tint_overrides_with_defaults.gni
+++ b/scripts/tint_overrides_with_defaults.gni
@@ -42,6 +42,7 @@
}
tint_has_fuzzers = tint_has_build
+tint_has_protobuf = tint_standalone || build_with_chromium
declare_args() {
# Path to tint checkout
@@ -118,6 +119,11 @@
tint_build_syntax_tree_writer = false
}
+ # Build the Syntax Tree writer
+ if (!defined(tint_build_ir_binary)) {
+ tint_build_ir_binary = tint_has_protobuf
+ }
+
# Build unittests
if (!defined(tint_build_unittests)) {
tint_build_unittests = true