[tools] Use new cnf library for conditions
Change-Id: I10b708b289113b2fe939b72cfc886707980a2f80
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/147741
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: James Price <jrprice@google.com>
diff --git a/src/tint/api/BUILD.cmake b/src/tint/api/BUILD.cmake
index e10faf6..930df1d 100644
--- a/src/tint/api/BUILD.cmake
+++ b/src/tint/api/BUILD.cmake
@@ -60,33 +60,33 @@
tint_utils_traits
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_api lib
tint_lang_glsl_writer
tint_lang_glsl_writer_common
)
endif(TINT_BUILD_GLSL_WRITER)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_api lib
tint_lang_hlsl_writer
)
endif(TINT_BUILD_HLSL_WRITER)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_api lib
tint_lang_msl_writer
tint_lang_msl_writer_common
)
endif(TINT_BUILD_MSL_WRITER)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_api lib
tint_lang_spirv_reader
)
endif(TINT_BUILD_SPV_READER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_api lib
tint_lang_spirv_writer
tint_lang_spirv_writer_common
diff --git a/src/tint/cmd/bench/BUILD.cmake b/src/tint/cmd/bench/BUILD.cmake
index 4964e60..ce4e4ad 100644
--- a/src/tint/cmd/bench/BUILD.cmake
+++ b/src/tint/cmd/bench/BUILD.cmake
@@ -88,31 +88,31 @@
tint_utils_traits
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_glsl_writer_bench
)
endif(TINT_BUILD_GLSL_WRITER)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_hlsl_writer_bench
)
endif(TINT_BUILD_HLSL_WRITER)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_msl_writer_bench
)
endif(TINT_BUILD_MSL_WRITER)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_spirv_reader
)
endif(TINT_BUILD_SPV_READER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_cmd_bench_bench_cmd bench_cmd
tint_lang_spirv_writer_bench
)
diff --git a/src/tint/cmd/common/BUILD.cmake b/src/tint/cmd/common/BUILD.cmake
index 468cbee..0d6d15f 100644
--- a/src/tint/cmd/common/BUILD.cmake
+++ b/src/tint/cmd/common/BUILD.cmake
@@ -59,17 +59,17 @@
tint_utils_traits
)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_cmd_common lib
tint_lang_spirv_reader
)
endif(TINT_BUILD_SPV_READER)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_cmd_common lib
"spirv-tools"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
################################################################################
# Target: tint_cmd_common_test
diff --git a/src/tint/cmd/info/BUILD.cmake b/src/tint/cmd/info/BUILD.cmake
index 6c8faf8..b90b31e 100644
--- a/src/tint/cmd/info/BUILD.cmake
+++ b/src/tint/cmd/info/BUILD.cmake
@@ -55,10 +55,10 @@
tint_utils_traits
)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_cmd_info_cmd cmd
"spirv-tools"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_set_output_name(tint_cmd_info_cmd cmd "tint_info")
diff --git a/src/tint/cmd/loopy/BUILD.cmake b/src/tint/cmd/loopy/BUILD.cmake
index 850af26..44d355e 100644
--- a/src/tint/cmd/loopy/BUILD.cmake
+++ b/src/tint/cmd/loopy/BUILD.cmake
@@ -60,40 +60,40 @@
tint_utils_traits
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_cmd_loopy_cmd cmd
tint_lang_glsl_writer
tint_lang_glsl_writer_common
)
endif(TINT_BUILD_GLSL_WRITER)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_cmd_loopy_cmd cmd
tint_lang_hlsl_writer
)
endif(TINT_BUILD_HLSL_WRITER)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_cmd_loopy_cmd cmd
tint_lang_core_ir
tint_lang_wgsl_reader_program_to_ir
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_cmd_loopy_cmd cmd
tint_lang_msl_writer
tint_lang_msl_writer_common
)
endif(TINT_BUILD_MSL_WRITER)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_cmd_loopy_cmd cmd
tint_lang_spirv_reader
)
endif(TINT_BUILD_SPV_READER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_cmd_loopy_cmd cmd
tint_lang_spirv_writer
tint_lang_spirv_writer_common
diff --git a/src/tint/cmd/test/BUILD.cmake b/src/tint/cmd/test/BUILD.cmake
index 59e2502..c25a473 100644
--- a/src/tint/cmd/test/BUILD.cmake
+++ b/src/tint/cmd/test/BUILD.cmake
@@ -69,19 +69,19 @@
"gtest"
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_glsl_writer_ast_printer_test
)
endif(TINT_BUILD_GLSL_WRITER)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_hlsl_writer_ast_printer_test
)
endif(TINT_BUILD_HLSL_WRITER)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_core_ir_transform_test
tint_lang_core_ir_test
@@ -90,26 +90,26 @@
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_msl_writer_ast_printer_test
tint_lang_msl_writer_common_test
)
endif(TINT_BUILD_MSL_WRITER)
-if (TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_msl_writer_printer_test
)
-endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_spirv_reader_ast_parser_test
)
endif(TINT_BUILD_SPV_READER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_spirv_writer_ast_printer_test
tint_lang_spirv_writer_common_test
@@ -117,10 +117,10 @@
)
endif(TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_cmd_test_test_cmd test_cmd
tint_lang_spirv_writer_raise_test
)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
tint_target_set_output_name(tint_cmd_test_test_cmd test_cmd "tint_unittests")
diff --git a/src/tint/cmd/tint/BUILD.cmake b/src/tint/cmd/tint/BUILD.cmake
index 8885563..0b32104 100644
--- a/src/tint/cmd/tint/BUILD.cmake
+++ b/src/tint/cmd/tint/BUILD.cmake
@@ -64,7 +64,7 @@
tint_utils_traits
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_cmd_tint_cmd cmd
tint_lang_glsl_writer
tint_lang_glsl_writer_common
@@ -75,21 +75,21 @@
)
endif(TINT_BUILD_GLSL_WRITER)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_cmd_tint_cmd cmd
tint_lang_hlsl_validate
tint_lang_hlsl_writer
)
endif(TINT_BUILD_HLSL_WRITER)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_cmd_tint_cmd cmd
tint_lang_core_ir
tint_lang_wgsl_reader_program_to_ir
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_cmd_tint_cmd cmd
tint_lang_msl_validate
tint_lang_msl_writer
@@ -97,19 +97,19 @@
)
endif(TINT_BUILD_MSL_WRITER)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_cmd_tint_cmd cmd
tint_lang_spirv_reader
)
endif(TINT_BUILD_SPV_READER)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_cmd_tint_cmd cmd
"spirv-tools"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_cmd_tint_cmd cmd
tint_lang_spirv_writer
tint_lang_spirv_writer_common
diff --git a/src/tint/lang/core/ir/BUILD.cmake b/src/tint/lang/core/ir/BUILD.cmake
index 8b5402f..0e8aede 100644
--- a/src/tint/lang/core/ir/BUILD.cmake
+++ b/src/tint/lang/core/ir/BUILD.cmake
@@ -222,7 +222,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_core_ir_test test
tint_lang_core_ir
)
diff --git a/src/tint/lang/core/ir/transform/BUILD.cmake b/src/tint/lang/core/ir/transform/BUILD.cmake
index 664b66c..5623215 100644
--- a/src/tint/lang/core/ir/transform/BUILD.cmake
+++ b/src/tint/lang/core/ir/transform/BUILD.cmake
@@ -70,7 +70,7 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_core_ir_transform lib
tint_lang_core_ir
)
@@ -121,7 +121,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_core_ir_transform_test test
tint_lang_core_ir
tint_lang_core_ir_transform
diff --git a/src/tint/lang/glsl/writer/BUILD.cmake b/src/tint/lang/glsl/writer/BUILD.cmake
index ad259c4..ef38b5d 100644
--- a/src/tint/lang/glsl/writer/BUILD.cmake
+++ b/src/tint/lang/glsl/writer/BUILD.cmake
@@ -62,7 +62,7 @@
tint_utils_traits
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_lang_glsl_writer lib
tint_lang_glsl_writer_ast_printer
tint_lang_glsl_writer_common
@@ -105,7 +105,7 @@
tint_utils_traits
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_lang_glsl_writer_bench bench
tint_lang_glsl_writer
tint_lang_glsl_writer_common
diff --git a/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake b/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake
index a42bb39..6f2cc8f 100644
--- a/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/glsl/writer/ast_printer/BUILD.cmake
@@ -59,7 +59,7 @@
tint_utils_traits
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_lang_glsl_writer_ast_printer lib
tint_lang_glsl_writer_common
)
@@ -139,7 +139,7 @@
"gtest"
)
-if (TINT_BUILD_GLSL_WRITER)
+if(TINT_BUILD_GLSL_WRITER)
tint_target_add_dependencies(tint_lang_glsl_writer_ast_printer_test test
tint_lang_glsl_writer
tint_lang_glsl_writer_ast_printer
diff --git a/src/tint/lang/hlsl/writer/BUILD.cmake b/src/tint/lang/hlsl/writer/BUILD.cmake
index 84d1744..613fba2 100644
--- a/src/tint/lang/hlsl/writer/BUILD.cmake
+++ b/src/tint/lang/hlsl/writer/BUILD.cmake
@@ -63,7 +63,7 @@
tint_utils_traits
)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_lang_hlsl_writer lib
tint_lang_hlsl_writer_ast_printer
)
@@ -106,7 +106,7 @@
tint_utils_traits
)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_lang_hlsl_writer_bench bench
tint_lang_hlsl_writer
)
diff --git a/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake b/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake
index 1033bc4..4a3b466 100644
--- a/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/hlsl/writer/ast_printer/BUILD.cmake
@@ -134,7 +134,7 @@
"gtest"
)
-if (TINT_BUILD_HLSL_WRITER)
+if(TINT_BUILD_HLSL_WRITER)
tint_target_add_dependencies(tint_lang_hlsl_writer_ast_printer_test test
tint_lang_hlsl_writer
tint_lang_hlsl_writer_ast_printer
diff --git a/src/tint/lang/msl/writer/BUILD.cmake b/src/tint/lang/msl/writer/BUILD.cmake
index bba6007..f7cd382 100644
--- a/src/tint/lang/msl/writer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/BUILD.cmake
@@ -64,25 +64,25 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_msl_writer lib
tint_lang_core_ir
tint_lang_wgsl_reader_program_to_ir
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_lang_msl_writer lib
tint_lang_msl_writer_ast_printer
tint_lang_msl_writer_common
)
endif(TINT_BUILD_MSL_WRITER)
-if (TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_msl_writer lib
tint_lang_msl_writer_printer
)
-endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
endif(TINT_BUILD_MSL_WRITER)
if(TINT_BUILD_MSL_WRITER)
@@ -120,7 +120,7 @@
tint_utils_traits
)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_lang_msl_writer_bench bench
tint_lang_msl_writer
tint_lang_msl_writer_common
diff --git a/src/tint/lang/msl/writer/ast_printer/BUILD.cmake b/src/tint/lang/msl/writer/ast_printer/BUILD.cmake
index 0f8fc43..42b6ab1 100644
--- a/src/tint/lang/msl/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/ast_printer/BUILD.cmake
@@ -58,7 +58,7 @@
tint_utils_traits
)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_lang_msl_writer_ast_printer lib
tint_lang_msl_writer_common
)
@@ -135,7 +135,7 @@
"gtest"
)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_lang_msl_writer_ast_printer_test test
tint_lang_msl_writer
tint_lang_msl_writer_ast_printer
diff --git a/src/tint/lang/msl/writer/common/BUILD.cmake b/src/tint/lang/msl/writer/common/BUILD.cmake
index 6aa766e..32ab82b 100644
--- a/src/tint/lang/msl/writer/common/BUILD.cmake
+++ b/src/tint/lang/msl/writer/common/BUILD.cmake
@@ -80,7 +80,7 @@
"gtest"
)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_lang_msl_writer_common_test test
tint_lang_msl_writer_common
)
diff --git a/src/tint/lang/msl/writer/printer/BUILD.cmake b/src/tint/lang/msl/writer/printer/BUILD.cmake
index 6b53c2f..c899f13 100644
--- a/src/tint/lang/msl/writer/printer/BUILD.cmake
+++ b/src/tint/lang/msl/writer/printer/BUILD.cmake
@@ -20,11 +20,11 @@
# Do not modify this file directly
################################################################################
-if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
################################################################################
# Target: tint_lang_msl_writer_printer
# Kind: lib
-# Condition: TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR
+# Condition: TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR
################################################################################
tint_add_target(tint_lang_msl_writer_printer lib
lang/msl/writer/printer/printer.cc
@@ -52,24 +52,24 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_msl_writer_printer lib
tint_lang_core_ir
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_MSL_WRITER)
+if(TINT_BUILD_MSL_WRITER)
tint_target_add_dependencies(tint_lang_msl_writer_printer lib
tint_lang_msl_writer_common
)
endif(TINT_BUILD_MSL_WRITER)
-endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
-if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
################################################################################
# Target: tint_lang_msl_writer_printer_test
# Kind: test
-# Condition: TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR
+# Condition: TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR
################################################################################
tint_add_target(tint_lang_msl_writer_printer_test test
lang/msl/writer/printer/binary_test.cc
@@ -109,16 +109,16 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_msl_writer_printer_test test
tint_lang_core_ir
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_msl_writer_printer_test test
tint_lang_msl_writer_printer
)
-endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
-endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
\ No newline at end of file
+endif(TINT_BUILD_MSL_WRITER AND TINT_BUILD_IR)
\ No newline at end of file
diff --git a/src/tint/lang/spirv/reader/BUILD.cmake b/src/tint/lang/spirv/reader/BUILD.cmake
index f54eb77..0e4ab13 100644
--- a/src/tint/lang/spirv/reader/BUILD.cmake
+++ b/src/tint/lang/spirv/reader/BUILD.cmake
@@ -56,7 +56,7 @@
tint_utils_traits
)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_lang_spirv_reader lib
tint_lang_spirv_reader_ast_parser
)
diff --git a/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake b/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake
index 7047e93..e8d9c3f 100644
--- a/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake
+++ b/src/tint/lang/spirv/reader/ast_parser/BUILD.cmake
@@ -75,12 +75,12 @@
tint_utils_traits
)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_reader_ast_parser lib
"spirv-headers"
"spirv-opt-internal"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
endif(TINT_BUILD_SPV_READER)
if(TINT_BUILD_SPV_READER)
@@ -156,18 +156,18 @@
"gtest"
)
-if (TINT_BUILD_SPV_READER)
+if(TINT_BUILD_SPV_READER)
tint_target_add_dependencies(tint_lang_spirv_reader_ast_parser_test test
tint_lang_spirv_reader_ast_parser
)
endif(TINT_BUILD_SPV_READER)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_reader_ast_parser_test test
"spirv-headers"
"spirv-opt-internal"
"spirv-tools"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
endif(TINT_BUILD_SPV_READER)
\ No newline at end of file
diff --git a/src/tint/lang/spirv/writer/BUILD.cmake b/src/tint/lang/spirv/writer/BUILD.cmake
index 2c8e5d4..3bd4ed8 100644
--- a/src/tint/lang/spirv/writer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/BUILD.cmake
@@ -61,7 +61,7 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer lib
tint_lang_core_ir
tint_lang_core_ir_transform
@@ -69,25 +69,25 @@
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer lib
"spirv-headers"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer lib
tint_lang_spirv_writer_ast_printer
tint_lang_spirv_writer_common
)
endif(TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer lib
tint_lang_spirv_writer_printer
tint_lang_spirv_writer_raise
)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
endif(TINT_BUILD_SPV_WRITER)
if(TINT_BUILD_SPV_WRITER)
@@ -124,7 +124,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_sources(tint_lang_spirv_writer_test test
"lang/spirv/writer/access_test.cc"
"lang/spirv/writer/atomic_builtin_test.cc"
@@ -152,26 +152,26 @@
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer_test test
"spirv-headers"
"spirv-tools"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_test test
tint_lang_spirv_writer_common
tint_lang_spirv_writer_common_test
)
endif(TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer_test test
tint_lang_spirv_writer_printer
tint_lang_spirv_writer_raise
)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
endif(TINT_BUILD_SPV_WRITER)
if(TINT_BUILD_SPV_WRITER)
@@ -208,13 +208,13 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_sources(tint_lang_spirv_writer_bench bench
"lang/spirv/writer/writer_bench.cc"
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_bench bench
tint_lang_spirv_writer
tint_lang_spirv_writer_common
diff --git a/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake b/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake
index b14b0d6..8c116ed 100644
--- a/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/ast_printer/BUILD.cmake
@@ -60,13 +60,13 @@
tint_utils_traits
)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer_ast_printer lib
"spirv-headers"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_ast_printer lib
tint_lang_spirv_writer_common
)
@@ -140,14 +140,14 @@
"gtest"
)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer_ast_printer_test test
"spirv-headers"
"spirv-tools"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_ast_printer_test test
tint_lang_spirv_writer
tint_lang_spirv_writer_ast_printer
diff --git a/src/tint/lang/spirv/writer/common/BUILD.cmake b/src/tint/lang/spirv/writer/common/BUILD.cmake
index e9f82aa..c92ed15 100644
--- a/src/tint/lang/spirv/writer/common/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/common/BUILD.cmake
@@ -51,11 +51,11 @@
tint_utils_traits
)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer_common lib
"spirv-headers"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
endif(TINT_BUILD_SPV_WRITER)
if(TINT_BUILD_SPV_WRITER)
@@ -98,7 +98,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_sources(tint_lang_spirv_writer_common_test test
"lang/spirv/writer/common/helper_test.h"
)
@@ -107,24 +107,24 @@
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer_common_test test
"spirv-headers"
"spirv-tools"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_common_test test
tint_lang_spirv_writer_common
)
endif(TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer_common_test test
tint_lang_spirv_writer_printer
tint_lang_spirv_writer_raise
)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
endif(TINT_BUILD_SPV_WRITER)
\ No newline at end of file
diff --git a/src/tint/lang/spirv/writer/printer/BUILD.cmake b/src/tint/lang/spirv/writer/printer/BUILD.cmake
index 126f52f..72ab825 100644
--- a/src/tint/lang/spirv/writer/printer/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/printer/BUILD.cmake
@@ -20,11 +20,11 @@
# Do not modify this file directly
################################################################################
-if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
################################################################################
# Target: tint_lang_spirv_writer_printer
# Kind: lib
-# Condition: TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR
+# Condition: TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR
################################################################################
tint_add_target(tint_lang_spirv_writer_printer lib
lang/spirv/writer/printer/printer.cc
@@ -55,29 +55,29 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer_printer lib
tint_lang_core_ir
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer_printer lib
"spirv-headers"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_printer lib
tint_lang_spirv_writer_ast_printer
tint_lang_spirv_writer_common
)
endif(TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer_printer lib
tint_lang_spirv_writer_raise
)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
\ No newline at end of file
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
\ No newline at end of file
diff --git a/src/tint/lang/spirv/writer/raise/BUILD.cmake b/src/tint/lang/spirv/writer/raise/BUILD.cmake
index c4bf2d7..a7052a1 100644
--- a/src/tint/lang/spirv/writer/raise/BUILD.cmake
+++ b/src/tint/lang/spirv/writer/raise/BUILD.cmake
@@ -20,11 +20,11 @@
# Do not modify this file directly
################################################################################
-if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
################################################################################
# Target: tint_lang_spirv_writer_raise
# Kind: lib
-# Condition: TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR
+# Condition: TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR
################################################################################
tint_add_target(tint_lang_spirv_writer_raise lib
lang/spirv/writer/raise/builtin_polyfill.cc
@@ -64,31 +64,31 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer_raise lib
tint_lang_core_ir
tint_lang_core_ir_transform
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
tint_target_add_external_dependencies(tint_lang_spirv_writer_raise lib
"spirv-headers"
)
-endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
+endif(TINT_BUILD_SPV_READER OR TINT_BUILD_SPV_WRITER)
-if (TINT_BUILD_SPV_WRITER)
+if(TINT_BUILD_SPV_WRITER)
tint_target_add_dependencies(tint_lang_spirv_writer_raise lib
tint_lang_spirv_writer_common
)
endif(TINT_BUILD_SPV_WRITER)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
-if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
################################################################################
# Target: tint_lang_spirv_writer_raise_test
# Kind: test
-# Condition: TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR
+# Condition: TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR
################################################################################
tint_add_target(tint_lang_spirv_writer_raise_test test
lang/spirv/writer/raise/builtin_polyfill_test.cc
@@ -123,17 +123,17 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer_raise_test test
tint_lang_core_ir
tint_lang_core_ir_transform_test
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_spirv_writer_raise_test test
tint_lang_spirv_writer_raise
)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
-endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
\ No newline at end of file
+endif(TINT_BUILD_SPV_WRITER AND TINT_BUILD_IR)
\ No newline at end of file
diff --git a/src/tint/lang/wgsl/BUILD.cmake b/src/tint/lang/wgsl/BUILD.cmake
index c55570f..e7d0dc1 100644
--- a/src/tint/lang/wgsl/BUILD.cmake
+++ b/src/tint/lang/wgsl/BUILD.cmake
@@ -68,7 +68,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_wgsl_test test
tint_lang_core_ir
tint_lang_wgsl_reader_program_to_ir
@@ -76,8 +76,8 @@
)
endif(TINT_BUILD_IR)
-if (TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER AND TINT_BUILD_IR)
+if(TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER AND TINT_BUILD_IR)
tint_target_add_sources(tint_lang_wgsl_test test
"lang/wgsl/ir_roundtrip_test.cc"
)
-endif(TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER AND TINT_BUILD_IR)
+endif(TINT_BUILD_WGSL_READER AND TINT_BUILD_WGSL_WRITER AND TINT_BUILD_IR)
diff --git a/src/tint/lang/wgsl/helpers/BUILD.cmake b/src/tint/lang/wgsl/helpers/BUILD.cmake
index d8a6beb..048427b 100644
--- a/src/tint/lang/wgsl/helpers/BUILD.cmake
+++ b/src/tint/lang/wgsl/helpers/BUILD.cmake
@@ -101,7 +101,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_wgsl_helpers_test test
tint_lang_core_ir
tint_lang_wgsl_reader_program_to_ir
diff --git a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
index 3b4f6dc..38e81e1 100644
--- a/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
+++ b/src/tint/lang/wgsl/reader/program_to_ir/BUILD.cmake
@@ -54,7 +54,7 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_wgsl_reader_program_to_ir lib
tint_lang_core_ir
)
@@ -113,7 +113,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_wgsl_reader_program_to_ir_test test
tint_lang_core_ir
tint_lang_wgsl_reader_program_to_ir
diff --git a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
index e76162b..426214e 100644
--- a/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
+++ b/src/tint/lang/wgsl/writer/ir_to_program/BUILD.cmake
@@ -57,7 +57,7 @@
tint_utils_traits
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_wgsl_writer_ir_to_program lib
tint_lang_core_ir
)
@@ -105,7 +105,7 @@
"gtest"
)
-if (TINT_BUILD_IR)
+if(TINT_BUILD_IR)
tint_target_add_dependencies(tint_lang_wgsl_writer_ir_to_program_test test
tint_lang_core_ir
tint_lang_core_ir_test
diff --git a/src/tint/utils/command/BUILD.cmake b/src/tint/utils/command/BUILD.cmake
index ccdc44f..ce450a3 100644
--- a/src/tint/utils/command/BUILD.cmake
+++ b/src/tint/utils/command/BUILD.cmake
@@ -33,19 +33,19 @@
tint_utils_text
)
-if ((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
+if((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
tint_target_add_sources(tint_utils_command lib
"utils/command/command_other.cc"
)
-endif((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
+endif((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
-if (IS_LINUX OR IS_MAC)
+if(IS_LINUX OR IS_MAC)
tint_target_add_sources(tint_utils_command lib
"utils/command/command_posix.cc"
)
-endif(IS_LINUX OR IS_MAC)
+endif(IS_LINUX OR IS_MAC)
-if (IS_WIN)
+if(IS_WIN)
tint_target_add_sources(tint_utils_command lib
"utils/command/command_windows.cc"
)
diff --git a/src/tint/utils/diagnostic/BUILD.cmake b/src/tint/utils/diagnostic/BUILD.cmake
index f5cae61..ec63e21 100644
--- a/src/tint/utils/diagnostic/BUILD.cmake
+++ b/src/tint/utils/diagnostic/BUILD.cmake
@@ -40,19 +40,19 @@
tint_utils_traits
)
-if ((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
+if((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
tint_target_add_sources(tint_utils_diagnostic lib
"utils/diagnostic/printer_other.cc"
)
-endif((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
+endif((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
-if (IS_LINUX OR IS_MAC)
+if(IS_LINUX OR IS_MAC)
tint_target_add_sources(tint_utils_diagnostic lib
"utils/diagnostic/printer_posix.cc"
)
-endif(IS_LINUX OR IS_MAC)
+endif(IS_LINUX OR IS_MAC)
-if (IS_WIN)
+if(IS_WIN)
tint_target_add_sources(tint_utils_diagnostic lib
"utils/diagnostic/printer_windows.cc"
)
diff --git a/src/tint/utils/file/BUILD.cmake b/src/tint/utils/file/BUILD.cmake
index 3ba7bea..2a88c4b 100644
--- a/src/tint/utils/file/BUILD.cmake
+++ b/src/tint/utils/file/BUILD.cmake
@@ -34,19 +34,19 @@
tint_utils_text
)
-if ((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
+if((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
tint_target_add_sources(tint_utils_file lib
"utils/file/tmpfile_other.cc"
)
-endif((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
+endif((NOT IS_LINUX) AND (NOT IS_MAC) AND (NOT IS_WIN))
-if (IS_LINUX OR IS_MAC)
+if(IS_LINUX OR IS_MAC)
tint_target_add_sources(tint_utils_file lib
"utils/file/tmpfile_posix.cc"
)
-endif(IS_LINUX OR IS_MAC)
+endif(IS_LINUX OR IS_MAC)
-if (IS_WIN)
+if(IS_WIN)
tint_target_add_sources(tint_utils_file lib
"utils/file/tmpfile_windows.cc"
)
diff --git a/tools/src/cmd/gen/build/BUILD.cmake.tmpl b/tools/src/cmd/gen/build/BUILD.cmake.tmpl
index 376be16..5ee97a3 100644
--- a/tools/src/cmd/gen/build/BUILD.cmake.tmpl
+++ b/tools/src/cmd/gen/build/BUILD.cmake.tmpl
@@ -87,7 +87,7 @@
{{- /* Emit conditional source files and dependencies */}}
{{- range $Cond := $.Conditionals}}
{{/* newline */}}
-if ({{Eval "Expression" $Cond.Condition}})
+if({{Eval "Expression" $Cond.Condition}})
{{- if $Cond.SourceFiles}}
tint_target_add_sources({{$Name}} {{$Kind}}
{{- range $File := $Cond.SourceFiles}}
@@ -139,11 +139,7 @@
--------------------------------------------------------------------------------
*/ -}}
{{- define "Expression"}}
-{{- $expr := $ }}
-{{- $expr = Replace $expr "!" "NOT "}}
-{{- $expr = Replace $expr "&&" " AND "}}
-{{- $expr = Replace $expr "||" " OR "}}
-{{- ToUpper $expr}}
+{{- ToUpper ($.Format " AND " " OR " "NOT ")}}
{{- end}}
{{- /* eat newlines */ -}}
diff --git a/tools/src/cmd/gen/build/BUILD.gn.tmpl b/tools/src/cmd/gen/build/BUILD.gn.tmpl
index 0c46af3..4d325de 100644
--- a/tools/src/cmd/gen/build/BUILD.gn.tmpl
+++ b/tools/src/cmd/gen/build/BUILD.gn.tmpl
@@ -150,7 +150,7 @@
{{- else if eq $.Name "spirv-headers" -}}"${tint_spirv_headers_dir}:spv_headers",
{{- else if eq $.Name "glslang" -}}"${tint_glslang_dir}:glslang_lib_sources",
{{- else if eq $.Name "glslang-res-limits" -}}"${tint_glslang_dir}:glslang_default_resource_limits_sources",
-{{- else -}}{{Error (printf "unhandled external dependency '%v'" $)}}
+{{- else -}}{{Error (printf "unhandled external dependency '%v'" $.Name)}}
{{- end}}
{{- end}}
diff --git a/tools/src/cmd/gen/build/build.go b/tools/src/cmd/gen/build/build.go
index ef4dd88..1678bd3 100644
--- a/tools/src/cmd/gen/build/build.go
+++ b/tools/src/cmd/gen/build/build.go
@@ -32,6 +32,7 @@
"strings"
"dawn.googlesource.com/dawn/tools/src/cmd/gen/common"
+ "dawn.googlesource.com/dawn/tools/src/cnf"
"dawn.googlesource.com/dawn/tools/src/container"
"dawn.googlesource.com/dawn/tools/src/fileutils"
"dawn.googlesource.com/dawn/tools/src/glob"
@@ -116,19 +117,20 @@
Condition string
}]()
if err := json.Unmarshal(jsonc.ToJSON(content), &externals); err != nil {
- return fmt.Errorf("failed to parse 'externals.json': %w", err)
+ return fmt.Errorf("failed to parse '%v': %w", p.externalsJsonPath, err)
}
for _, name := range externals.Keys() {
external := externals[name]
if len(external.IncludePatterns) == 0 {
- return fmt.Errorf("'externals.json': '%v' requires at least one pattern in IncludePatterns", name)
+ return fmt.Errorf("%v: '%v' requires at least one pattern in IncludePatterns",
+ p.externalsJsonPath, name)
}
matchers := []match.Test{}
for _, pattern := range external.IncludePatterns {
matcher, err := match.New(pattern)
if err != nil {
- return fmt.Errorf("'externals.json': matcher error: %w", err)
+ return fmt.Errorf("%v: matcher error: %w", p.externalsJsonPath, err)
}
matchers = append(matchers, matcher)
}
@@ -141,10 +143,16 @@
return false
}
+ cond, err := cnf.Parse(external.Condition)
+ if err != nil {
+ return fmt.Errorf("%v: could not parse condition: %w",
+ p.externalsJsonPath, err)
+ }
+
name := ExternalDependencyName(name)
p.externals.Add(name, ExternalDependency{
Name: name,
- Condition: external.Condition,
+ Condition: cond,
includePatternMatch: match,
})
}
@@ -243,11 +251,14 @@
// Apply any conditions
for _, condition := range parsed.conditions {
- if file.Condition == "" {
- file.Condition = condition
- } else {
- file.Condition += " && " + condition
+ cond, err := cnf.Parse(condition)
+ if err != nil {
+ return fmt.Errorf("%v: could not parse condition: %w", file, err)
}
+ if file.Condition != nil {
+ cond = cnf.Optimize(cnf.And(file.Condition, cond))
+ }
+ file.Condition = cond
}
file.Includes = append(file.Includes, parsed.includes...)
@@ -276,7 +287,11 @@
// Apply any directory-level condition
for _, target := range dir.Targets() {
- target.Condition = cfg.Condition
+ cond, err := cnf.Parse(cfg.Condition)
+ if err != nil {
+ return fmt.Errorf("%v: could not parse condition: %w", path, err)
+ }
+ target.Condition = cond
}
// For each target config...
diff --git a/tools/src/cmd/gen/build/condition.go b/tools/src/cmd/gen/build/condition.go
new file mode 100644
index 0000000..7bb95e6
--- /dev/null
+++ b/tools/src/cmd/gen/build/condition.go
@@ -0,0 +1,19 @@
+// Copyright 2023 The Tint Authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package build
+
+import "dawn.googlesource.com/dawn/tools/src/cnf"
+
+type Condition = cnf.Expr
diff --git a/tools/src/cmd/gen/build/dependencies.go b/tools/src/cmd/gen/build/dependencies.go
index 0578966..21468e3 100644
--- a/tools/src/cmd/gen/build/dependencies.go
+++ b/tools/src/cmd/gen/build/dependencies.go
@@ -59,7 +59,7 @@
// UnconditionalInternal returns the sorted list of dependencies that have no build condition.
func (d *Dependencies) UnconditionalInternal() []*Target {
- return transform.Filter(d.Internal(), func(d *Target) bool { return d.Condition == "" })
+ return transform.Filter(d.Internal(), func(d *Target) bool { return d.Condition == nil })
}
// External returns the sorted list of external dependencies.
@@ -74,13 +74,13 @@
// ConditionalExternalDependencies returns the sorted list of external dependencies that have a
// build condition.
func (d *Dependencies) ConditionalExternal() []ExternalDependency {
- return transform.Filter(d.External(), func(e ExternalDependency) bool { return e.Condition != "" })
+ return transform.Filter(d.External(), func(e ExternalDependency) bool { return e.Condition != nil })
}
// ConditionalExternalDependencies returns the sorted list of external dependencies that have no
// build condition.
func (d *Dependencies) UnconditionalExternal() []ExternalDependency {
- return transform.Filter(d.External(), func(e ExternalDependency) bool { return e.Condition == "" })
+ return transform.Filter(d.External(), func(e ExternalDependency) bool { return e.Condition == nil })
}
// ContainsExternal returns true if the external dependencies contains name
diff --git a/tools/src/cmd/gen/build/directory.go b/tools/src/cmd/gen/build/directory.go
index 32bebd1..cd1c04ca 100644
--- a/tools/src/cmd/gen/build/directory.go
+++ b/tools/src/cmd/gen/build/directory.go
@@ -18,6 +18,7 @@
"path"
"strings"
+ "dawn.googlesource.com/dawn/tools/src/cnf"
"dawn.googlesource.com/dawn/tools/src/container"
)
@@ -65,3 +66,48 @@
}
return out
}
+
+// DecomposedConditionals returns the combined decomposed ANDs, ORs and unary expressions of all
+// the conditional expressions used by the targets in this directory. This can be used by templates
+// that need to break expressions down into separate sub-expressions.
+func (d *Directory) DecomposedConditionals() cnf.Decomposed {
+ // Gather up all the conditional expressions used by targets in this directory
+ expressions := container.NewMap[cnf.Key, cnf.Expr]()
+ addExpr := func(expr cnf.Expr) {
+ if len(expr) > 0 {
+ expressions.Add(expr.Key(), expr)
+ }
+ }
+ for _, target := range d.Targets() {
+ addExpr(target.Condition)
+ for _, c := range target.Conditionals() {
+ addExpr(c.Condition)
+ }
+ }
+
+ // Build maps for the AND, OR and unary sub-expressions.
+ allAnds := container.NewMap[cnf.Key, cnf.Ands]()
+ allOrs := container.NewMap[cnf.Key, cnf.Ors]()
+ allUnarys := container.NewMap[cnf.Key, cnf.Unary]()
+
+ // Populate the maps
+ for _, expr := range expressions {
+ decomposed := cnf.Decompose(expr)
+ for _, ands := range decomposed.Ands {
+ allAnds.Add(ands.Key(), ands)
+ }
+ for _, ors := range decomposed.Ors {
+ allOrs.Add(ors.Key(), ors)
+ }
+ for _, unarys := range decomposed.Unarys {
+ allUnarys.Add(unarys.Key(), unarys)
+ }
+ }
+
+ // Return the decomposed expressions
+ return cnf.Decomposed{
+ Ands: allAnds.Values(),
+ Ors: allOrs.Values(),
+ Unarys: allUnarys.Values(),
+ }
+}
diff --git a/tools/src/cmd/gen/build/external_dependency.go b/tools/src/cmd/gen/build/external_dependency.go
index a411d34..c58ab6d 100644
--- a/tools/src/cmd/gen/build/external_dependency.go
+++ b/tools/src/cmd/gen/build/external_dependency.go
@@ -22,7 +22,7 @@
// See 'externals.json'
Name ExternalDependencyName
// The optional condition for using this dependency
- Condition string
+ Condition Condition
// Include file pattern matcher
includePatternMatch match.Test
}
diff --git a/tools/src/cmd/gen/build/file.go b/tools/src/cmd/gen/build/file.go
index 28d339a..7fb9b9c 100644
--- a/tools/src/cmd/gen/build/file.go
+++ b/tools/src/cmd/gen/build/file.go
@@ -31,7 +31,7 @@
// The name of the file
Name string
// An optional condition used to build this source file
- Condition string
+ Condition Condition
// All the #include made by this file
Includes []Include
// All the transitive dependencies of this file
diff --git a/tools/src/cmd/gen/build/target.go b/tools/src/cmd/gen/build/target.go
index ebb21c7..e988bcfa 100644
--- a/tools/src/cmd/gen/build/target.go
+++ b/tools/src/cmd/gen/build/target.go
@@ -36,7 +36,7 @@
// An optional custom output name for the target
OutputName string
// An optional condition for building this target
- Condition string
+ Condition Condition
}
// AddSourceFile adds the File to the target's source set
@@ -56,12 +56,12 @@
// SourceFiles returns the sorted list of the target's source files that have no build condition
func (t *Target) UnconditionalSourceFiles() []*File {
- return transform.Filter(t.SourceFiles(), func(t *File) bool { return t.Condition == "" })
+ return transform.Filter(t.SourceFiles(), func(t *File) bool { return t.Condition == nil })
}
// A collection of source files and dependencies sharing the same condition
type TargetConditional struct {
- Condition string
+ Condition Condition
SourceFiles []*File
InternalDependencies []*Target
ExternalDependencies []ExternalDependency
@@ -95,8 +95,8 @@
m := container.NewMap[string, *TargetConditional]()
for name := range t.SourceFileSet {
file := t.Directory.Project.Files[name]
- if file.Condition != "" {
- c := m.GetOrCreate(file.Condition, func() *TargetConditional {
+ if file.Condition != nil {
+ c := m.GetOrCreate(file.Condition.String(), func() *TargetConditional {
return &TargetConditional{Condition: file.Condition}
})
c.SourceFiles = append(c.SourceFiles, file)
@@ -104,8 +104,8 @@
}
for name := range t.Dependencies.internal {
dep := t.Directory.Project.Targets[name]
- if dep.Condition != "" {
- c := m.GetOrCreate(dep.Condition, func() *TargetConditional {
+ if dep.Condition != nil {
+ c := m.GetOrCreate(dep.Condition.String(), func() *TargetConditional {
return &TargetConditional{Condition: dep.Condition}
})
c.InternalDependencies = append(c.InternalDependencies, dep)
@@ -113,8 +113,8 @@
}
for name := range t.Dependencies.external {
dep := t.Directory.Project.externals[name]
- if dep.Condition != "" {
- c := m.GetOrCreate(dep.Condition, func() *TargetConditional {
+ if dep.Condition != nil {
+ c := m.GetOrCreate(dep.Condition.String(), func() *TargetConditional {
return &TargetConditional{Condition: dep.Condition}
})
c.ExternalDependencies = append(c.ExternalDependencies, dep)