blob: 85918623309404d70419e31dea34e20eb7380da0 [file] [log] [blame]
# Copyright 2021 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.
import("//build_overrides/build.gni")
import("../../scripts/dawn_overrides_with_defaults.gni")
import("../../tint_overrides_with_defaults.gni")
if (tint_build_unittests) {
import("//testing/test.gni")
}
###############################################################################
# Common - Configs, etc. shared across targets
###############################################################################
config("tint_common_config") {
include_dirs = [
"${target_gen_dir}",
"${tint_root_dir}/",
"${tint_spirv_headers_dir}/include",
"${tint_spirv_tools_dir}/",
"${tint_spirv_tools_dir}/include",
]
}
config("tint_public_config") {
defines = []
if (tint_build_spv_reader) {
defines += [ "TINT_BUILD_SPV_READER=1" ]
} else {
defines += [ "TINT_BUILD_SPV_READER=0" ]
}
if (tint_build_spv_writer) {
defines += [ "TINT_BUILD_SPV_WRITER=1" ]
} else {
defines += [ "TINT_BUILD_SPV_WRITER=0" ]
}
if (tint_build_wgsl_reader) {
defines += [ "TINT_BUILD_WGSL_READER=1" ]
} else {
defines += [ "TINT_BUILD_WGSL_READER=0" ]
}
if (tint_build_wgsl_writer) {
defines += [ "TINT_BUILD_WGSL_WRITER=1" ]
} else {
defines += [ "TINT_BUILD_WGSL_WRITER=0" ]
}
if (tint_build_msl_writer) {
defines += [ "TINT_BUILD_MSL_WRITER=1" ]
} else {
defines += [ "TINT_BUILD_MSL_WRITER=0" ]
}
if (tint_build_hlsl_writer) {
defines += [ "TINT_BUILD_HLSL_WRITER=1" ]
} else {
defines += [ "TINT_BUILD_HLSL_WRITER=0" ]
}
if (tint_build_glsl_writer) {
defines += [ "TINT_BUILD_GLSL_WRITER=1" ]
} else {
defines += [ "TINT_BUILD_GLSL_WRITER=0" ]
}
if (tint_build_syntax_tree_writer) {
defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=1" ]
} else {
defines += [ "TINT_BUILD_SYNTAX_TREE_WRITER=0" ]
}
if (tint_build_ir) {
defines += [ "TINT_BUILD_IR=1" ]
} else {
defines += [ "TINT_BUILD_IR=0" ]
}
include_dirs = [
"${tint_root_dir}/",
"${tint_root_dir}/include/",
"${tint_spirv_headers_dir}/include",
]
}
config("tint_config") {
include_dirs = []
if (tint_build_spv_reader || tint_build_spv_writer) {
include_dirs += [ "${tint_spirv_tools_dir}/include/" ]
}
}
group("abseil") {
# When build_with_chromium=true we need to include "//third_party/abseil-cpp:absl" while
# it's beneficial to be more specific with standalone Dawn, especially when it comes to
# including it as a dependency in other projects (such as Skia).
if (build_with_chromium) {
public_deps = [ "$dawn_abseil_dir:absl" ]
} else {
public_deps = [ "${dawn_root}/third_party/gn/abseil-cpp:strings" ]
}
}
###############################################################################
# Helper library for IO operations
# Only to be used by tests and sample executable
###############################################################################
source_set("tint_utils_io") {
sources = [
"utils/command/command.h",
"utils/file/tmpfile.h",
]
if (is_linux || is_mac) {
sources += [ "utils/command/command_posix.cc" ]
sources += [ "utils/file/tmpfile_posix.cc" ]
} else if (is_win) {
sources += [ "utils/command/command_windows.cc" ]
sources += [ "utils/file/tmpfile_windows.cc" ]
} else {
sources += [ "utils/command/command_other.cc" ]
sources += [ "utils/file/tmpfile_other.cc" ]
}
deps = [ ":libtint_utils_src" ]
}
###############################################################################
# Helper library for validating generated shaders
# As this depends on tint_utils_io, this is only to be used by tests and sample
# executable
###############################################################################
source_set("tint_val") {
sources = [
"lang/hlsl/validate/hlsl.cc",
"lang/hlsl/validate/val.h",
"lang/msl/validate/msl.cc",
"lang/msl/validate/val.h",
]
deps = [
":libtint_ast_src",
":libtint_program_src",
":libtint_utils_src",
":tint_utils_io",
]
}
###############################################################################
# Library - Tint core and optional modules of libtint
###############################################################################
# Targets that want to use tint as a library should depend on ":libtint" and
# use the build flags to control what is included, instead of trying to specify
# the subsets that they want.
template("libtint_source_set") {
source_set(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (!defined(invoker.deps)) {
deps = []
}
deps += [
"${tint_spirv_headers_dir}:spv_headers",
"${tint_spirv_tools_dir}:spvtools_core_enums_unified1",
"${tint_spirv_tools_dir}:spvtools_core_tables_unified1",
"${tint_spirv_tools_dir}:spvtools_headers",
"${tint_spirv_tools_dir}:spvtools_language_header_cldebuginfo100",
"${tint_spirv_tools_dir}:spvtools_language_header_debuginfo",
"${tint_spirv_tools_dir}:spvtools_language_header_vkdebuginfo100",
]
if (defined(invoker.configs)) {
configs += invoker.configs
}
configs += [ ":tint_common_config" ]
if (build_with_chromium) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
if (!defined(invoker.public_configs)) {
public_configs = []
}
public_configs += [ ":tint_public_config" ]
}
}
libtint_source_set("libtint_symbols_src") {
sources = [
"utils/containers/scope_stack.h",
"utils/id/generation_id.cc",
"utils/id/generation_id.h",
"utils/reflection/reflection.h",
"utils/symbol/symbol.cc",
"utils/symbol/symbol.h",
"utils/symbol/symbol_table.cc",
"utils/symbol/symbol_table.h",
]
deps = [ ":libtint_utils_src" ]
}
libtint_source_set("libtint_utils_src") {
sources = [
"utils/cli/cli.cc",
"utils/cli/cli.h",
"utils/containers/bitset.h",
"utils/containers/enum_set.h",
"utils/containers/hashmap.h",
"utils/containers/hashmap_base.h",
"utils/containers/hashset.h",
"utils/containers/map.h",
"utils/containers/predicates.h",
"utils/containers/slice.h",
"utils/containers/unique_allocator.h",
"utils/containers/unique_vector.h",
"utils/containers/vector.h",
"utils/debug/debugger.cc",
"utils/debug/debugger.h",
"utils/diagnostic/diagnostic.cc",
"utils/diagnostic/diagnostic.h",
"utils/diagnostic/formatter.cc",
"utils/diagnostic/formatter.h",
"utils/diagnostic/printer.cc",
"utils/diagnostic/printer.h",
"utils/diagnostic/source.cc",
"utils/diagnostic/source.h",
"utils/ice/ice.cc",
"utils/ice/ice.h",
"utils/macros/compiler.h",
"utils/macros/concat.h",
"utils/macros/defer.h",
"utils/macros/foreach.h",
"utils/macros/scoped_assignment.h",
"utils/math/crc32.h",
"utils/math/hash.h",
"utils/math/math.h",
"utils/memory/bitcast.h",
"utils/memory/block_allocator.h",
"utils/memory/bump_allocator.h",
"utils/rtti/castable.cc",
"utils/rtti/castable.h",
"utils/rtti/switch.h",
"utils/strconv/parse_num.cc",
"utils/strconv/parse_num.h",
"utils/text/string.cc",
"utils/text/string.h",
"utils/text/string_stream.cc",
"utils/text/string_stream.h",
"utils/text/unicode.cc",
"utils/text/unicode.h",
"utils/traits/traits.h",
]
if (is_linux || is_mac) {
sources += [ "utils/diagnostic/printer_posix.cc" ]
} else if (is_win) {
sources += [ "utils/diagnostic/printer_windows.cc" ]
} else {
sources += [ "utils/diagnostic/printer_other.cc" ]
}
deps = [ ":abseil" ]
}
libtint_source_set("libtint_clone_context_hdrs") {
sources = [ "lang/wgsl/ast/clone_context.h" ]
deps = [
":libtint_symbols_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_program_src") {
sources = [
"lang/core/constant/eval.cc",
"lang/core/constant/eval.h",
"lang/core/intrinsic/ctor_conv.cc",
"lang/core/intrinsic/ctor_conv.h",
"lang/core/intrinsic/data/data.cc",
"lang/core/intrinsic/data/data.h",
"lang/core/intrinsic/data/type_matchers.h",
"lang/core/intrinsic/table.cc",
"lang/core/intrinsic/table.h",
"lang/wgsl/program/clone_context.cc",
"lang/wgsl/program/program.cc",
"lang/wgsl/program/program_builder.cc",
"lang/wgsl/resolver/dependency_graph.cc",
"lang/wgsl/resolver/dependency_graph.h",
"lang/wgsl/resolver/resolve.cc",
"lang/wgsl/resolver/resolver.cc",
"lang/wgsl/resolver/sem_helper.cc",
"lang/wgsl/resolver/sem_helper.h",
"lang/wgsl/resolver/uniformity.cc",
"lang/wgsl/resolver/uniformity.h",
"lang/wgsl/resolver/validator.cc",
"lang/wgsl/resolver/validator.h",
]
public = [
"lang/wgsl/program/program.h",
"lang/wgsl/program/program_builder.h",
"lang/wgsl/resolver/resolver.h",
]
friend = [
":tint_unittests_resolver_src", # For resolver test access
]
public_deps = [ ":libtint_clone_context_hdrs" ]
deps = [
":libtint_ast_hdrs",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_initializer_src") {
sources = [ "tint.cc" ]
}
libtint_source_set("libtint_inspector_src") {
sources = [
"lang/wgsl/inspector/entry_point.cc",
"lang/wgsl/inspector/entry_point.h",
"lang/wgsl/inspector/inspector.cc",
"lang/wgsl/inspector/inspector.h",
"lang/wgsl/inspector/resource_binding.cc",
"lang/wgsl/inspector/resource_binding.h",
"lang/wgsl/inspector/scalar.cc",
"lang/wgsl/inspector/scalar.h",
]
deps = [
":libtint_ast_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_ast_transform_base_src") {
sources = [
"lang/wgsl/ast/transform/data.cc",
"lang/wgsl/ast/transform/data.h",
"lang/wgsl/ast/transform/manager.cc",
"lang/wgsl/ast/transform/manager.h",
"lang/wgsl/ast/transform/transform.cc",
"lang/wgsl/ast/transform/transform.h",
]
deps = [
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_ast_transform_src") {
sources = [
"lang/wgsl/ast/transform/add_block_attribute.cc",
"lang/wgsl/ast/transform/add_block_attribute.h",
"lang/wgsl/ast/transform/add_empty_entry_point.cc",
"lang/wgsl/ast/transform/add_empty_entry_point.h",
"lang/wgsl/ast/transform/array_length_from_uniform.cc",
"lang/wgsl/ast/transform/array_length_from_uniform.h",
"lang/wgsl/ast/transform/binding_remapper.cc",
"lang/wgsl/ast/transform/binding_remapper.h",
"lang/wgsl/ast/transform/builtin_polyfill.cc",
"lang/wgsl/ast/transform/builtin_polyfill.h",
"lang/wgsl/ast/transform/calculate_array_length.cc",
"lang/wgsl/ast/transform/calculate_array_length.h",
"lang/wgsl/ast/transform/canonicalize_entry_point_io.cc",
"lang/wgsl/ast/transform/canonicalize_entry_point_io.h",
"lang/wgsl/ast/transform/clamp_frag_depth.cc",
"lang/wgsl/ast/transform/clamp_frag_depth.h",
"lang/wgsl/ast/transform/combine_samplers.cc",
"lang/wgsl/ast/transform/combine_samplers.h",
"lang/wgsl/ast/transform/decompose_memory_access.cc",
"lang/wgsl/ast/transform/decompose_memory_access.h",
"lang/wgsl/ast/transform/decompose_strided_array.cc",
"lang/wgsl/ast/transform/decompose_strided_array.h",
"lang/wgsl/ast/transform/decompose_strided_matrix.cc",
"lang/wgsl/ast/transform/decompose_strided_matrix.h",
"lang/wgsl/ast/transform/demote_to_helper.cc",
"lang/wgsl/ast/transform/demote_to_helper.h",
"lang/wgsl/ast/transform/direct_variable_access.cc",
"lang/wgsl/ast/transform/direct_variable_access.h",
"lang/wgsl/ast/transform/disable_uniformity_analysis.cc",
"lang/wgsl/ast/transform/disable_uniformity_analysis.h",
"lang/wgsl/ast/transform/expand_compound_assignment.cc",
"lang/wgsl/ast/transform/expand_compound_assignment.h",
"lang/wgsl/ast/transform/first_index_offset.cc",
"lang/wgsl/ast/transform/first_index_offset.h",
"lang/wgsl/ast/transform/fold_trivial_lets.cc",
"lang/wgsl/ast/transform/fold_trivial_lets.h",
"lang/wgsl/ast/transform/for_loop_to_loop.cc",
"lang/wgsl/ast/transform/for_loop_to_loop.h",
"lang/wgsl/ast/transform/get_insertion_point.cc",
"lang/wgsl/ast/transform/get_insertion_point.h",
"lang/wgsl/ast/transform/hoist_to_decl_before.cc",
"lang/wgsl/ast/transform/hoist_to_decl_before.h",
"lang/wgsl/ast/transform/localize_struct_array_assignment.cc",
"lang/wgsl/ast/transform/localize_struct_array_assignment.h",
"lang/wgsl/ast/transform/merge_return.cc",
"lang/wgsl/ast/transform/merge_return.h",
"lang/wgsl/ast/transform/module_scope_var_to_entry_point_param.cc",
"lang/wgsl/ast/transform/module_scope_var_to_entry_point_param.h",
"lang/wgsl/ast/transform/multiplanar_external_texture.cc",
"lang/wgsl/ast/transform/multiplanar_external_texture.h",
"lang/wgsl/ast/transform/num_workgroups_from_uniform.cc",
"lang/wgsl/ast/transform/num_workgroups_from_uniform.h",
"lang/wgsl/ast/transform/packed_vec3.cc",
"lang/wgsl/ast/transform/packed_vec3.h",
"lang/wgsl/ast/transform/pad_structs.cc",
"lang/wgsl/ast/transform/pad_structs.h",
"lang/wgsl/ast/transform/preserve_padding.cc",
"lang/wgsl/ast/transform/preserve_padding.h",
"lang/wgsl/ast/transform/promote_initializers_to_let.cc",
"lang/wgsl/ast/transform/promote_initializers_to_let.h",
"lang/wgsl/ast/transform/promote_side_effects_to_decl.cc",
"lang/wgsl/ast/transform/promote_side_effects_to_decl.h",
"lang/wgsl/ast/transform/remove_continue_in_switch.cc",
"lang/wgsl/ast/transform/remove_continue_in_switch.h",
"lang/wgsl/ast/transform/remove_phonies.cc",
"lang/wgsl/ast/transform/remove_phonies.h",
"lang/wgsl/ast/transform/remove_unreachable_statements.cc",
"lang/wgsl/ast/transform/remove_unreachable_statements.h",
"lang/wgsl/ast/transform/renamer.cc",
"lang/wgsl/ast/transform/renamer.h",
"lang/wgsl/ast/transform/robustness.cc",
"lang/wgsl/ast/transform/robustness.h",
"lang/wgsl/ast/transform/simplify_pointers.cc",
"lang/wgsl/ast/transform/simplify_pointers.h",
"lang/wgsl/ast/transform/single_entry_point.cc",
"lang/wgsl/ast/transform/single_entry_point.h",
"lang/wgsl/ast/transform/spirv_atomic.cc",
"lang/wgsl/ast/transform/spirv_atomic.h",
"lang/wgsl/ast/transform/std140.cc",
"lang/wgsl/ast/transform/std140.h",
"lang/wgsl/ast/transform/substitute_override.cc",
"lang/wgsl/ast/transform/substitute_override.h",
"lang/wgsl/ast/transform/texture_1d_to_2d.cc",
"lang/wgsl/ast/transform/texture_1d_to_2d.h",
"lang/wgsl/ast/transform/truncate_interstage_variables.cc",
"lang/wgsl/ast/transform/truncate_interstage_variables.h",
"lang/wgsl/ast/transform/unshadow.cc",
"lang/wgsl/ast/transform/unshadow.h",
"lang/wgsl/ast/transform/var_for_dynamic_index.cc",
"lang/wgsl/ast/transform/var_for_dynamic_index.h",
"lang/wgsl/ast/transform/vectorize_matrix_conversions.cc",
"lang/wgsl/ast/transform/vectorize_matrix_conversions.h",
"lang/wgsl/ast/transform/vectorize_scalar_matrix_initializers.cc",
"lang/wgsl/ast/transform/vectorize_scalar_matrix_initializers.h",
"lang/wgsl/ast/transform/vertex_pulling.cc",
"lang/wgsl/ast/transform/vertex_pulling.h",
"lang/wgsl/ast/transform/while_to_loop.cc",
"lang/wgsl/ast/transform/while_to_loop.h",
"lang/wgsl/ast/transform/zero_init_workgroup_memory.cc",
"lang/wgsl/ast/transform/zero_init_workgroup_memory.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
if (tint_build_ir) {
libtint_source_set("libtint_ir_transform_src") {
sources = [
"lang/core/ir/transform/add_empty_entry_point.cc",
"lang/core/ir/transform/add_empty_entry_point.h",
"lang/core/ir/transform/bgra8unorm_polyfill.cc",
"lang/core/ir/transform/bgra8unorm_polyfill.h",
"lang/core/ir/transform/binding_remapper.cc",
"lang/core/ir/transform/binding_remapper.h",
"lang/core/ir/transform/block_decorated_structs.cc",
"lang/core/ir/transform/block_decorated_structs.h",
"lang/core/ir/transform/builtin_polyfill.cc",
"lang/core/ir/transform/builtin_polyfill.h",
"lang/core/ir/transform/demote_to_helper.cc",
"lang/core/ir/transform/demote_to_helper.h",
"lang/core/ir/transform/shader_io.cc",
"lang/core/ir/transform/shader_io.h",
"lang/core/ir/transform/std140.cc",
"lang/core/ir/transform/std140.h",
]
deps = [
":libtint_builtins_src",
":libtint_ir_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
}
libtint_source_set("libtint_ast_hdrs") {
sources = [
"lang/wgsl/ast/accessor_expression.h",
"lang/wgsl/ast/alias.h",
"lang/wgsl/ast/assignment_statement.h",
"lang/wgsl/ast/attribute.h",
"lang/wgsl/ast/binary_expression.h",
"lang/wgsl/ast/binding_attribute.h",
"lang/wgsl/ast/bitcast_expression.h",
"lang/wgsl/ast/block_statement.h",
"lang/wgsl/ast/bool_literal_expression.h",
"lang/wgsl/ast/break_if_statement.h",
"lang/wgsl/ast/break_statement.h",
"lang/wgsl/ast/builtin_attribute.h",
"lang/wgsl/ast/call_expression.h",
"lang/wgsl/ast/call_statement.h",
"lang/wgsl/ast/case_selector.h",
"lang/wgsl/ast/case_statement.h",
"lang/wgsl/ast/compound_assignment_statement.h",
"lang/wgsl/ast/const.h",
"lang/wgsl/ast/const_assert.h",
"lang/wgsl/ast/continue_statement.h",
"lang/wgsl/ast/diagnostic_attribute.h",
"lang/wgsl/ast/diagnostic_control.h",
"lang/wgsl/ast/diagnostic_directive.h",
"lang/wgsl/ast/diagnostic_rule_name.h",
"lang/wgsl/ast/disable_validation_attribute.h",
"lang/wgsl/ast/discard_statement.h",
"lang/wgsl/ast/enable.h",
"lang/wgsl/ast/expression.h",
"lang/wgsl/ast/extension.h",
"lang/wgsl/ast/float_literal_expression.h",
"lang/wgsl/ast/for_loop_statement.h",
"lang/wgsl/ast/function.h",
"lang/wgsl/ast/group_attribute.h",
"lang/wgsl/ast/id_attribute.h",
"lang/wgsl/ast/identifier.h",
"lang/wgsl/ast/identifier_expression.h",
"lang/wgsl/ast/if_statement.h",
"lang/wgsl/ast/increment_decrement_statement.h",
"lang/wgsl/ast/index_accessor_expression.h",
"lang/wgsl/ast/index_attribute.h",
"lang/wgsl/ast/int_literal_expression.h",
"lang/wgsl/ast/internal_attribute.h",
"lang/wgsl/ast/interpolate_attribute.h",
"lang/wgsl/ast/invariant_attribute.h",
"lang/wgsl/ast/let.h",
"lang/wgsl/ast/literal_expression.h",
"lang/wgsl/ast/location_attribute.h",
"lang/wgsl/ast/loop_statement.h",
"lang/wgsl/ast/member_accessor_expression.h",
"lang/wgsl/ast/module.h",
"lang/wgsl/ast/must_use_attribute.h",
"lang/wgsl/ast/node.h",
"lang/wgsl/ast/node_id.h",
"lang/wgsl/ast/override.h",
"lang/wgsl/ast/parameter.h",
"lang/wgsl/ast/phony_expression.h",
"lang/wgsl/ast/pipeline_stage.h",
"lang/wgsl/ast/return_statement.h",
"lang/wgsl/ast/stage_attribute.h",
"lang/wgsl/ast/statement.h",
"lang/wgsl/ast/stride_attribute.h",
"lang/wgsl/ast/struct.h",
"lang/wgsl/ast/struct_member.h",
"lang/wgsl/ast/struct_member_align_attribute.h",
"lang/wgsl/ast/struct_member_offset_attribute.h",
"lang/wgsl/ast/struct_member_size_attribute.h",
"lang/wgsl/ast/switch_statement.h",
"lang/wgsl/ast/templated_identifier.h",
"lang/wgsl/ast/traverse_expressions.h",
"lang/wgsl/ast/type.h",
"lang/wgsl/ast/type_decl.h",
"lang/wgsl/ast/unary_op_expression.h",
"lang/wgsl/ast/var.h",
"lang/wgsl/ast/variable.h",
"lang/wgsl/ast/variable_decl_statement.h",
"lang/wgsl/ast/while_statement.h",
"lang/wgsl/ast/workgroup_attribute.h",
]
deps = [
":libtint_builtins_src",
":libtint_clone_context_hdrs",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_ast_src") {
sources = [
"lang/wgsl/ast/accessor_expression.cc",
"lang/wgsl/ast/alias.cc",
"lang/wgsl/ast/assignment_statement.cc",
"lang/wgsl/ast/attribute.cc",
"lang/wgsl/ast/binary_expression.cc",
"lang/wgsl/ast/binding_attribute.cc",
"lang/wgsl/ast/bitcast_expression.cc",
"lang/wgsl/ast/block_statement.cc",
"lang/wgsl/ast/bool_literal_expression.cc",
"lang/wgsl/ast/break_if_statement.cc",
"lang/wgsl/ast/break_statement.cc",
"lang/wgsl/ast/builder.cc",
"lang/wgsl/ast/builtin_attribute.cc",
"lang/wgsl/ast/call_expression.cc",
"lang/wgsl/ast/call_statement.cc",
"lang/wgsl/ast/case_selector.cc",
"lang/wgsl/ast/case_statement.cc",
"lang/wgsl/ast/clone_context.cc",
"lang/wgsl/ast/compound_assignment_statement.cc",
"lang/wgsl/ast/const.cc",
"lang/wgsl/ast/const_assert.cc",
"lang/wgsl/ast/continue_statement.cc",
"lang/wgsl/ast/diagnostic_attribute.cc",
"lang/wgsl/ast/diagnostic_control.cc",
"lang/wgsl/ast/diagnostic_directive.cc",
"lang/wgsl/ast/diagnostic_rule_name.cc",
"lang/wgsl/ast/disable_validation_attribute.cc",
"lang/wgsl/ast/discard_statement.cc",
"lang/wgsl/ast/enable.cc",
"lang/wgsl/ast/expression.cc",
"lang/wgsl/ast/extension.cc",
"lang/wgsl/ast/float_literal_expression.cc",
"lang/wgsl/ast/for_loop_statement.cc",
"lang/wgsl/ast/function.cc",
"lang/wgsl/ast/group_attribute.cc",
"lang/wgsl/ast/id_attribute.cc",
"lang/wgsl/ast/identifier.cc",
"lang/wgsl/ast/identifier_expression.cc",
"lang/wgsl/ast/if_statement.cc",
"lang/wgsl/ast/increment_decrement_statement.cc",
"lang/wgsl/ast/index_accessor_expression.cc",
"lang/wgsl/ast/index_attribute.cc",
"lang/wgsl/ast/int_literal_expression.cc",
"lang/wgsl/ast/internal_attribute.cc",
"lang/wgsl/ast/interpolate_attribute.cc",
"lang/wgsl/ast/invariant_attribute.cc",
"lang/wgsl/ast/let.cc",
"lang/wgsl/ast/literal_expression.cc",
"lang/wgsl/ast/location_attribute.cc",
"lang/wgsl/ast/loop_statement.cc",
"lang/wgsl/ast/member_accessor_expression.cc",
"lang/wgsl/ast/module.cc",
"lang/wgsl/ast/must_use_attribute.cc",
"lang/wgsl/ast/node.cc",
"lang/wgsl/ast/override.cc",
"lang/wgsl/ast/parameter.cc",
"lang/wgsl/ast/phony_expression.cc",
"lang/wgsl/ast/pipeline_stage.cc",
"lang/wgsl/ast/return_statement.cc",
"lang/wgsl/ast/stage_attribute.cc",
"lang/wgsl/ast/statement.cc",
"lang/wgsl/ast/stride_attribute.cc",
"lang/wgsl/ast/struct.cc",
"lang/wgsl/ast/struct_member.cc",
"lang/wgsl/ast/struct_member_align_attribute.cc",
"lang/wgsl/ast/struct_member_offset_attribute.cc",
"lang/wgsl/ast/struct_member_size_attribute.cc",
"lang/wgsl/ast/switch_statement.cc",
"lang/wgsl/ast/templated_identifier.cc",
"lang/wgsl/ast/type.cc",
"lang/wgsl/ast/type_decl.cc",
"lang/wgsl/ast/unary_op_expression.cc",
"lang/wgsl/ast/var.cc",
"lang/wgsl/ast/variable.cc",
"lang/wgsl/ast/variable_decl_statement.cc",
"lang/wgsl/ast/while_statement.cc",
"lang/wgsl/ast/workgroup_attribute.cc",
]
public_deps = [ ":libtint_ast_hdrs" ]
deps = [
":libtint_builtins_src",
":libtint_program_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_sem_src") {
sources = [
"lang/core/evaluation_stage.h",
"lang/core/parameter_usage.cc",
"lang/core/parameter_usage.h",
"lang/wgsl/sem/accessor_expression.cc",
"lang/wgsl/sem/accessor_expression.h",
"lang/wgsl/sem/array_count.cc",
"lang/wgsl/sem/array_count.h",
"lang/wgsl/sem/behavior.cc",
"lang/wgsl/sem/behavior.h",
"lang/wgsl/sem/block_statement.cc",
"lang/wgsl/sem/block_statement.h",
"lang/wgsl/sem/break_if_statement.cc",
"lang/wgsl/sem/break_if_statement.h",
"lang/wgsl/sem/builtin.cc",
"lang/wgsl/sem/builtin.h",
"lang/wgsl/sem/builtin_enum_expression.cc",
"lang/wgsl/sem/builtin_enum_expression.h",
"lang/wgsl/sem/call.cc",
"lang/wgsl/sem/call.h",
"lang/wgsl/sem/call_target.cc",
"lang/wgsl/sem/call_target.h",
"lang/wgsl/sem/expression.cc",
"lang/wgsl/sem/expression.h",
"lang/wgsl/sem/for_loop_statement.cc",
"lang/wgsl/sem/for_loop_statement.h",
"lang/wgsl/sem/function.cc",
"lang/wgsl/sem/function.h",
"lang/wgsl/sem/function_expression.cc",
"lang/wgsl/sem/function_expression.h",
"lang/wgsl/sem/if_statement.cc",
"lang/wgsl/sem/if_statement.h",
"lang/wgsl/sem/index_accessor_expression.cc",
"lang/wgsl/sem/index_accessor_expression.h",
"lang/wgsl/sem/info.cc",
"lang/wgsl/sem/info.h",
"lang/wgsl/sem/load.cc",
"lang/wgsl/sem/load.h",
"lang/wgsl/sem/loop_statement.cc",
"lang/wgsl/sem/loop_statement.h",
"lang/wgsl/sem/materialize.cc",
"lang/wgsl/sem/materialize.h",
"lang/wgsl/sem/member_accessor_expression.cc",
"lang/wgsl/sem/member_accessor_expression.h",
"lang/wgsl/sem/module.cc",
"lang/wgsl/sem/module.h",
"lang/wgsl/sem/node.cc",
"lang/wgsl/sem/node.h",
"lang/wgsl/sem/pipeline_stage_set.h",
"lang/wgsl/sem/sampler_texture_pair.h",
"lang/wgsl/sem/statement.cc",
"lang/wgsl/sem/statement.h",
"lang/wgsl/sem/struct.cc",
"lang/wgsl/sem/struct.h",
"lang/wgsl/sem/switch_statement.cc",
"lang/wgsl/sem/switch_statement.h",
"lang/wgsl/sem/type_expression.cc",
"lang/wgsl/sem/type_expression.h",
"lang/wgsl/sem/type_mappings.h",
"lang/wgsl/sem/value_constructor.cc",
"lang/wgsl/sem/value_constructor.h",
"lang/wgsl/sem/value_conversion.cc",
"lang/wgsl/sem/value_conversion.h",
"lang/wgsl/sem/value_expression.cc",
"lang/wgsl/sem/value_expression.h",
"lang/wgsl/sem/variable.cc",
"lang/wgsl/sem/variable.h",
"lang/wgsl/sem/while_statement.cc",
"lang/wgsl/sem/while_statement.h",
]
deps = [
":libtint_ast_hdrs",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_builtins_src") {
sources = [
"lang/core/access.cc",
"lang/core/access.h",
"lang/core/address_space.cc",
"lang/core/address_space.h",
"lang/core/attribute.cc",
"lang/core/attribute.h",
"lang/core/binary_op.cc",
"lang/core/binary_op.h",
"lang/core/builtin.cc",
"lang/core/builtin.h",
"lang/core/builtin_value.cc",
"lang/core/builtin_value.h",
"lang/core/diagnostic_rule.cc",
"lang/core/diagnostic_rule.h",
"lang/core/diagnostic_severity.cc",
"lang/core/diagnostic_severity.h",
"lang/core/extension.cc",
"lang/core/extension.h",
"lang/core/fluent_types.h",
"lang/core/function.cc",
"lang/core/function.h",
"lang/core/interpolation.h",
"lang/core/interpolation_sampling.cc",
"lang/core/interpolation_sampling.h",
"lang/core/interpolation_type.cc",
"lang/core/interpolation_type.h",
"lang/core/number.cc",
"lang/core/number.h",
"lang/core/texel_format.cc",
"lang/core/texel_format.h",
"lang/core/unary_op.cc",
"lang/core/unary_op.h",
]
deps = [ ":libtint_utils_src" ]
}
libtint_source_set("libtint_type_src") {
sources = [
"lang/core/type/abstract_float.cc",
"lang/core/type/abstract_float.h",
"lang/core/type/abstract_int.cc",
"lang/core/type/abstract_int.h",
"lang/core/type/abstract_numeric.cc",
"lang/core/type/abstract_numeric.h",
"lang/core/type/array.cc",
"lang/core/type/array.h",
"lang/core/type/array_count.cc",
"lang/core/type/array_count.h",
"lang/core/type/atomic.cc",
"lang/core/type/atomic.h",
"lang/core/type/bool.cc",
"lang/core/type/bool.h",
"lang/core/type/builtin_structs.cc",
"lang/core/type/builtin_structs.h",
"lang/core/type/clone_context.h",
"lang/core/type/depth_multisampled_texture.cc",
"lang/core/type/depth_multisampled_texture.h",
"lang/core/type/depth_texture.cc",
"lang/core/type/depth_texture.h",
"lang/core/type/external_texture.cc",
"lang/core/type/external_texture.h",
"lang/core/type/f16.cc",
"lang/core/type/f16.h",
"lang/core/type/f32.cc",
"lang/core/type/f32.h",
"lang/core/type/i32.cc",
"lang/core/type/i32.h",
"lang/core/type/manager.cc",
"lang/core/type/manager.h",
"lang/core/type/matrix.cc",
"lang/core/type/matrix.h",
"lang/core/type/multisampled_texture.cc",
"lang/core/type/multisampled_texture.h",
"lang/core/type/node.cc",
"lang/core/type/node.h",
"lang/core/type/numeric_scalar.cc",
"lang/core/type/numeric_scalar.h",
"lang/core/type/pointer.cc",
"lang/core/type/pointer.h",
"lang/core/type/reference.cc",
"lang/core/type/reference.h",
"lang/core/type/sampled_texture.cc",
"lang/core/type/sampled_texture.h",
"lang/core/type/sampler.cc",
"lang/core/type/sampler.h",
"lang/core/type/sampler_kind.cc",
"lang/core/type/sampler_kind.h",
"lang/core/type/scalar.cc",
"lang/core/type/scalar.h",
"lang/core/type/storage_texture.cc",
"lang/core/type/storage_texture.h",
"lang/core/type/struct.cc",
"lang/core/type/struct.h",
"lang/core/type/texture.cc",
"lang/core/type/texture.h",
"lang/core/type/texture_dimension.cc",
"lang/core/type/texture_dimension.h",
"lang/core/type/type.cc",
"lang/core/type/type.h",
"lang/core/type/u32.cc",
"lang/core/type/u32.h",
"lang/core/type/unique_node.cc",
"lang/core/type/unique_node.h",
"lang/core/type/vector.cc",
"lang/core/type/vector.h",
"lang/core/type/void.cc",
"lang/core/type/void.h",
]
deps = [
":libtint_builtins_src",
":libtint_symbols_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_constant_src") {
sources = [
"lang/core/constant/clone_context.h",
"lang/core/constant/composite.cc",
"lang/core/constant/composite.h",
"lang/core/constant/manager.cc",
"lang/core/constant/manager.h",
"lang/core/constant/node.cc",
"lang/core/constant/node.h",
"lang/core/constant/scalar.cc",
"lang/core/constant/scalar.h",
"lang/core/constant/splat.cc",
"lang/core/constant/splat.h",
"lang/core/constant/value.cc",
"lang/core/constant/value.h",
]
deps = [
":libtint_builtins_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_spv_reader_src") {
sources = [
"lang/spirv/reader/ast_parser/ast_parser.cc",
"lang/spirv/reader/ast_parser/ast_parser.h",
"lang/spirv/reader/ast_parser/attributes.h",
"lang/spirv/reader/ast_parser/construct.cc",
"lang/spirv/reader/ast_parser/construct.h",
"lang/spirv/reader/ast_parser/entry_point_info.cc",
"lang/spirv/reader/ast_parser/entry_point_info.h",
"lang/spirv/reader/ast_parser/enum_converter.cc",
"lang/spirv/reader/ast_parser/enum_converter.h",
"lang/spirv/reader/ast_parser/fail_stream.h",
"lang/spirv/reader/ast_parser/function.cc",
"lang/spirv/reader/ast_parser/function.h",
"lang/spirv/reader/ast_parser/namer.cc",
"lang/spirv/reader/ast_parser/namer.h",
"lang/spirv/reader/ast_parser/type.cc",
"lang/spirv/reader/ast_parser/type.h",
"lang/spirv/reader/ast_parser/usage.cc",
"lang/spirv/reader/ast_parser/usage.h",
"lang/spirv/reader/reader.cc",
"lang/spirv/reader/reader.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
"${tint_spirv_tools_dir}/:spvtools_opt",
]
public_configs = [ "${tint_spirv_tools_dir}/:spvtools_internal_config" ]
}
libtint_source_set("libtint_writer_src") {
sources = [
"lang/wgsl/helpers/append_vector.cc",
"lang/wgsl/helpers/append_vector.h",
"lang/wgsl/helpers/check_supported_extensions.cc",
"lang/wgsl/helpers/check_supported_extensions.h",
"lang/wgsl/helpers/flatten_bindings.cc",
"lang/wgsl/helpers/flatten_bindings.h",
"utils/generator/text_generator.cc",
"utils/generator/text_generator.h",
"utils/strconv/float_to_string.cc",
"utils/strconv/float_to_string.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_inspector_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_spv_writer_src") {
sources = [
"lang/spirv/writer/ast_printer/ast_printer.cc",
"lang/spirv/writer/ast_printer/ast_printer.h",
"lang/spirv/writer/ast_printer/builder.cc",
"lang/spirv/writer/ast_printer/builder.h",
"lang/spirv/writer/ast_printer/scalar_constant.h",
"lang/spirv/writer/common/binary_writer.cc",
"lang/spirv/writer/common/binary_writer.h",
"lang/spirv/writer/common/function.cc",
"lang/spirv/writer/common/function.h",
"lang/spirv/writer/common/instruction.cc",
"lang/spirv/writer/common/instruction.h",
"lang/spirv/writer/common/module.cc",
"lang/spirv/writer/common/module.h",
"lang/spirv/writer/common/operand.cc",
"lang/spirv/writer/common/operand.h",
"lang/spirv/writer/writer.cc",
"lang/spirv/writer/writer.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
if (tint_build_ir) {
sources += [
"lang/spirv/writer/printer/printer.cc",
"lang/spirv/writer/printer/printer.h",
"lang/spirv/writer/raise/builtin_polyfill.cc",
"lang/spirv/writer/raise/builtin_polyfill.h",
"lang/spirv/writer/raise/expand_implicit_splats.cc",
"lang/spirv/writer/raise/expand_implicit_splats.h",
"lang/spirv/writer/raise/handle_matrix_arithmetic.cc",
"lang/spirv/writer/raise/handle_matrix_arithmetic.h",
"lang/spirv/writer/raise/merge_return.cc",
"lang/spirv/writer/raise/merge_return.h",
"lang/spirv/writer/raise/raise.cc",
"lang/spirv/writer/raise/raise.h",
"lang/spirv/writer/raise/shader_io.cc",
"lang/spirv/writer/raise/shader_io.h",
"lang/spirv/writer/raise/var_for_dynamic_index.cc",
"lang/spirv/writer/raise/var_for_dynamic_index.h",
]
deps += [
":libtint_ir_src",
":libtint_ir_transform_src",
":libtint_wgsl_reader_program_to_ir_src",
":libtint_wgsl_writer_ir_to_program_src",
]
}
}
libtint_source_set("libtint_wgsl_reader_src") {
sources = [
"lang/wgsl/reader/parser/classify_template_args.cc",
"lang/wgsl/reader/parser/classify_template_args.h",
"lang/wgsl/reader/parser/detail.h",
"lang/wgsl/reader/parser/lexer.cc",
"lang/wgsl/reader/parser/lexer.h",
"lang/wgsl/reader/parser/parser.cc",
"lang/wgsl/reader/parser/parser.h",
"lang/wgsl/reader/parser/token.cc",
"lang/wgsl/reader/parser/token.h",
"lang/wgsl/reader/reader.cc",
"lang/wgsl/reader/reader.h",
]
deps = [
":libtint_ast_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
if (tint_build_ir) {
libtint_source_set("libtint_wgsl_reader_program_to_ir_src") {
sources = []
deps = []
if (tint_build_ir) {
sources += [
"lang/wgsl/reader/program_to_ir/program_to_ir.cc",
"lang/wgsl/reader/program_to_ir/program_to_ir.h",
]
deps += [
":libtint_ast_src",
":libtint_ir_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
}
libtint_source_set("libtint_wgsl_writer_ir_to_program_src") {
sources = [
"lang/wgsl/writer/ir_to_program/ir_to_program.cc",
"lang/wgsl/writer/ir_to_program/ir_to_program.h",
"lang/wgsl/writer/ir_to_program/rename_conflicts.cc",
"lang/wgsl/writer/ir_to_program/rename_conflicts.h",
]
deps = [
":libtint_ast_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_ir_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
}
libtint_source_set("libtint_wgsl_writer_src") {
sources = [
"lang/wgsl/writer/ast_printer/ast_printer.cc",
"lang/wgsl/writer/ast_printer/ast_printer.h",
"lang/wgsl/writer/options.cc",
"lang/wgsl/writer/options.h",
"lang/wgsl/writer/output.cc",
"lang/wgsl/writer/output.h",
"lang/wgsl/writer/writer.cc",
"lang/wgsl/writer/writer.h",
]
deps = [
":libtint_ast_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_syntax_tree_writer_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
}
libtint_source_set("libtint_msl_writer_src") {
sources = [
"lang/msl/writer/ast_printer/ast_printer.cc",
"lang/msl/writer/ast_printer/ast_printer.h",
"lang/msl/writer/common/options.cc",
"lang/msl/writer/common/options.h",
"lang/msl/writer/common/printer_support.cc",
"lang/msl/writer/common/printer_support.h",
"lang/msl/writer/output.cc",
"lang/msl/writer/output.h",
"lang/msl/writer/writer.cc",
"lang/msl/writer/writer.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
if (tint_build_ir) {
sources += [
"lang/msl/writer/printer/printer.cc",
"lang/msl/writer/printer/printer.h",
]
deps += [
":libtint_ir_src",
":libtint_ir_transform_src",
":libtint_wgsl_writer_ir_to_program_src",
]
}
}
libtint_source_set("libtint_hlsl_writer_src") {
sources = [
"lang/hlsl/writer/ast_printer/ast_printer.cc",
"lang/hlsl/writer/ast_printer/ast_printer.h",
"lang/hlsl/writer/common/options.cc",
"lang/hlsl/writer/common/options.h",
"lang/hlsl/writer/output.cc",
"lang/hlsl/writer/output.h",
"lang/hlsl/writer/writer.cc",
"lang/hlsl/writer/writer.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
}
libtint_source_set("libtint_glsl_writer_src") {
sources = [
"lang/glsl/writer/ast_printer/ast_printer.cc",
"lang/glsl/writer/ast_printer/ast_printer.h",
"lang/glsl/writer/common/options.cc",
"lang/glsl/writer/common/options.h",
"lang/glsl/writer/common/version.h",
"lang/glsl/writer/output.cc",
"lang/glsl/writer/output.h",
"lang/glsl/writer/writer.cc",
"lang/glsl/writer/writer.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
}
libtint_source_set("libtint_syntax_tree_writer_src") {
sources = [
"lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.cc",
"lang/wgsl/writer/syntax_tree_printer/syntax_tree_printer.h",
]
deps = [
":libtint_ast_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
}
if (tint_build_ir) {
libtint_source_set("libtint_ir_src") {
sources = [
"lang/core/ir/access.cc",
"lang/core/ir/access.h",
"lang/core/ir/binary.cc",
"lang/core/ir/binary.h",
"lang/core/ir/bitcast.cc",
"lang/core/ir/bitcast.h",
"lang/core/ir/block.cc",
"lang/core/ir/block.h",
"lang/core/ir/block_param.cc",
"lang/core/ir/block_param.h",
"lang/core/ir/break_if.cc",
"lang/core/ir/break_if.h",
"lang/core/ir/builder.cc",
"lang/core/ir/builder.h",
"lang/core/ir/builtin_call.cc",
"lang/core/ir/builtin_call.h",
"lang/core/ir/call.cc",
"lang/core/ir/call.h",
"lang/core/ir/constant.cc",
"lang/core/ir/constant.h",
"lang/core/ir/construct.cc",
"lang/core/ir/construct.h",
"lang/core/ir/continue.cc",
"lang/core/ir/continue.h",
"lang/core/ir/control_instruction.cc",
"lang/core/ir/control_instruction.h",
"lang/core/ir/convert.cc",
"lang/core/ir/convert.h",
"lang/core/ir/core_builtin_call.cc",
"lang/core/ir/core_builtin_call.h",
"lang/core/ir/disassembler.cc",
"lang/core/ir/disassembler.h",
"lang/core/ir/discard.cc",
"lang/core/ir/discard.h",
"lang/core/ir/exit.cc",
"lang/core/ir/exit.h",
"lang/core/ir/exit_if.cc",
"lang/core/ir/exit_if.h",
"lang/core/ir/exit_loop.cc",
"lang/core/ir/exit_loop.h",
"lang/core/ir/exit_switch.cc",
"lang/core/ir/exit_switch.h",
"lang/core/ir/function.cc",
"lang/core/ir/function.h",
"lang/core/ir/function_param.cc",
"lang/core/ir/function_param.h",
"lang/core/ir/if.cc",
"lang/core/ir/if.h",
"lang/core/ir/instruction.cc",
"lang/core/ir/instruction.h",
"lang/core/ir/instruction_result.cc",
"lang/core/ir/instruction_result.h",
"lang/core/ir/intrinsic_call.cc",
"lang/core/ir/intrinsic_call.h",
"lang/core/ir/let.cc",
"lang/core/ir/let.h",
"lang/core/ir/load.cc",
"lang/core/ir/load.h",
"lang/core/ir/load_vector_element.cc",
"lang/core/ir/load_vector_element.h",
"lang/core/ir/location.h",
"lang/core/ir/loop.cc",
"lang/core/ir/loop.h",
"lang/core/ir/module.cc",
"lang/core/ir/module.h",
"lang/core/ir/multi_in_block.cc",
"lang/core/ir/multi_in_block.h",
"lang/core/ir/next_iteration.cc",
"lang/core/ir/next_iteration.h",
"lang/core/ir/operand_instruction.cc",
"lang/core/ir/operand_instruction.h",
"lang/core/ir/return.cc",
"lang/core/ir/return.h",
"lang/core/ir/store.cc",
"lang/core/ir/store.h",
"lang/core/ir/store_vector_element.cc",
"lang/core/ir/store_vector_element.h",
"lang/core/ir/switch.cc",
"lang/core/ir/switch.h",
"lang/core/ir/swizzle.cc",
"lang/core/ir/swizzle.h",
"lang/core/ir/terminate_invocation.cc",
"lang/core/ir/terminate_invocation.h",
"lang/core/ir/terminator.cc",
"lang/core/ir/terminator.h",
"lang/core/ir/unary.cc",
"lang/core/ir/unary.h",
"lang/core/ir/unreachable.cc",
"lang/core/ir/unreachable.h",
"lang/core/ir/user_call.cc",
"lang/core/ir/user_call.h",
"lang/core/ir/validator.cc",
"lang/core/ir/validator.h",
"lang/core/ir/value.cc",
"lang/core/ir/value.h",
"lang/core/ir/var.cc",
"lang/core/ir/var.h",
]
deps = [
":libtint_builtins_src",
":libtint_constant_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
}
source_set("libtint") {
public_deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_initializer_src",
":libtint_inspector_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
if (tint_build_spv_reader) {
public_deps += [ ":libtint_spv_reader_src" ]
}
if (tint_build_spv_writer) {
public_deps += [ ":libtint_spv_writer_src" ]
}
if (tint_build_wgsl_reader) {
public_deps += [ ":libtint_wgsl_reader_src" ]
}
if (tint_build_wgsl_writer) {
public_deps += [ ":libtint_wgsl_writer_src" ]
}
if (tint_build_msl_writer) {
public_deps += [ ":libtint_msl_writer_src" ]
}
if (tint_build_hlsl_writer) {
public_deps += [ ":libtint_hlsl_writer_src" ]
}
if (tint_build_glsl_writer) {
public_deps += [ ":libtint_glsl_writer_src" ]
}
if (tint_build_syntax_tree_writer) {
public_deps += [ ":libtint_syntax_tree_writer_src" ]
}
if (tint_build_ir) {
assert(!build_with_chromium,
"tint_build_ir cannot be used when building Chromium")
public_deps += [
":libtint_ir_src",
":libtint_wgsl_writer_ir_to_program_src",
]
}
configs += [ ":tint_common_config" ]
public_configs = [ ":tint_public_config" ]
if (build_with_chromium) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
}
if (tint_build_unittests) {
###############################################################################
# Gtest Gmock - Handle building inside and outside of Chromium.
###############################################################################
# When building outside of Chromium we need to define our own targets for GTest
# and GMock. However when compiling inside of Chromium we need to reuse the
# existing targets, both because Chromium has a special harness for swarming
# and because otherwise the "gn check" fails.
if (!build_with_chromium) {
# When we aren't in Chromium we define out own targets based on the location
# of the googletest repo.
config("gtest_config") {
include_dirs = [
"${tint_googletest_dir}/googletest",
"${tint_googletest_dir}/googletest/include",
]
}
static_library("gtest") {
testonly = true
sources = [ "${tint_googletest_dir}/googletest/src/gtest-all.cc" ]
public_configs = [ ":gtest_config" ]
}
config("gmock_config") {
include_dirs = [
"${tint_googletest_dir}/googlemock",
"${tint_googletest_dir}/googlemock/include",
"${tint_googletest_dir}/googletest/include",
]
}
static_library("gmock") {
testonly = true
sources = [ "${tint_googletest_dir}/googlemock/src/gmock-all.cc" ]
public_configs = [ ":gmock_config" ]
}
group("gmock_and_gtest") {
testonly = true
public_deps = [
":gmock",
":gtest",
]
}
} else {
# When we are in Chromium we reuse its targets, and also add some deps that
# are needed to launch the test in swarming mode.
group("gmock_and_gtest") {
testonly = true
public_deps = [
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/googletest:gmock",
]
}
}
###############################################################################
# Wrapping of Chromium targets
###############################################################################
# These targets are separated because they are Chromium sources files that
# can't use the tint_internal config, otherwise Tint's warning flags get
# applied while compiling a bunch of Chromium's //base (via header inclusion)
source_set("tint_unittests_main") {
testonly = true
deps = [ ":gmock_and_gtest" ]
if (build_with_chromium) {
sources = [ "//gpu/tint_unittests_main.cc" ]
} else {
sources = [ "test_main.cc" ]
configs += [ ":tint_unittests_config" ]
deps += [ ":libtint" ]
if (tint_build_hlsl_writer) {
deps += [ ":tint_unittests_hlsl_writer_src" ]
}
if (tint_build_msl_writer) {
deps += [ ":tint_unittests_msl_writer_ast_printer_src" ]
}
if (tint_build_spv_reader) {
deps += [ ":tint_unittests_spv_reader_src" ]
}
}
}
###############################################################################
# Tests - For libtint core and optional modules
###############################################################################
config("tint_unittests_config") {
include_dirs = [
"${tint_googletest_dir}/googlemock/include",
"${tint_googletest_dir}/googletest/include",
]
configs = [
":tint_common_config",
":tint_public_config",
]
}
template("tint_unittests_source_set") {
source_set(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (defined(invoker.configs)) {
configs += invoker.configs
}
configs += [ ":tint_unittests_config" ]
if (build_with_chromium) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
testonly = true
if (!defined(invoker.deps)) {
deps = []
}
deps += [
":gmock_and_gtest",
":libtint",
":tint_utils_io",
]
}
}
tint_unittests_source_set("libtint_unittests_ast_helper") {
sources = [
"lang/wgsl/ast/helper_test.cc",
"lang/wgsl/ast/helper_test.h",
]
deps = [ ":libtint_ast_src" ]
}
tint_unittests_source_set("tint_unittests_ast_src") {
sources = [
"lang/wgsl/ast/alias_test.cc",
"lang/wgsl/ast/assignment_statement_test.cc",
"lang/wgsl/ast/binary_expression_test.cc",
"lang/wgsl/ast/binding_attribute_test.cc",
"lang/wgsl/ast/bitcast_expression_test.cc",
"lang/wgsl/ast/block_statement_test.cc",
"lang/wgsl/ast/bool_literal_expression_test.cc",
"lang/wgsl/ast/break_if_statement_test.cc",
"lang/wgsl/ast/break_statement_test.cc",
"lang/wgsl/ast/builtin_attribute_test.cc",
"lang/wgsl/ast/builtin_texture_helper_test.cc",
"lang/wgsl/ast/builtin_texture_helper_test.h",
"lang/wgsl/ast/call_expression_test.cc",
"lang/wgsl/ast/call_statement_test.cc",
"lang/wgsl/ast/case_selector_test.cc",
"lang/wgsl/ast/case_statement_test.cc",
"lang/wgsl/ast/clone_context_test.cc",
"lang/wgsl/ast/compound_assignment_statement_test.cc",
"lang/wgsl/ast/const_assert_test.cc",
"lang/wgsl/ast/continue_statement_test.cc",
"lang/wgsl/ast/diagnostic_attribute_test.cc",
"lang/wgsl/ast/diagnostic_control_test.cc",
"lang/wgsl/ast/diagnostic_directive_test.cc",
"lang/wgsl/ast/diagnostic_rule_name_test.cc",
"lang/wgsl/ast/discard_statement_test.cc",
"lang/wgsl/ast/enable_test.cc",
"lang/wgsl/ast/float_literal_expression_test.cc",
"lang/wgsl/ast/for_loop_statement_test.cc",
"lang/wgsl/ast/function_test.cc",
"lang/wgsl/ast/group_attribute_test.cc",
"lang/wgsl/ast/id_attribute_test.cc",
"lang/wgsl/ast/identifier_expression_test.cc",
"lang/wgsl/ast/identifier_test.cc",
"lang/wgsl/ast/if_statement_test.cc",
"lang/wgsl/ast/increment_decrement_statement_test.cc",
"lang/wgsl/ast/index_accessor_expression_test.cc",
"lang/wgsl/ast/index_attribute_test.cc",
"lang/wgsl/ast/int_literal_expression_test.cc",
"lang/wgsl/ast/interpolate_attribute_test.cc",
"lang/wgsl/ast/location_attribute_test.cc",
"lang/wgsl/ast/loop_statement_test.cc",
"lang/wgsl/ast/member_accessor_expression_test.cc",
"lang/wgsl/ast/module_test.cc",
"lang/wgsl/ast/phony_expression_test.cc",
"lang/wgsl/ast/return_statement_test.cc",
"lang/wgsl/ast/stage_attribute_test.cc",
"lang/wgsl/ast/stride_attribute_test.cc",
"lang/wgsl/ast/struct_member_align_attribute_test.cc",
"lang/wgsl/ast/struct_member_offset_attribute_test.cc",
"lang/wgsl/ast/struct_member_size_attribute_test.cc",
"lang/wgsl/ast/struct_member_test.cc",
"lang/wgsl/ast/struct_test.cc",
"lang/wgsl/ast/switch_statement_test.cc",
"lang/wgsl/ast/templated_identifier_test.cc",
"lang/wgsl/ast/traverse_expressions_test.cc",
"lang/wgsl/ast/unary_op_expression_test.cc",
"lang/wgsl/ast/variable_decl_statement_test.cc",
"lang/wgsl/ast/variable_test.cc",
"lang/wgsl/ast/while_statement_test.cc",
"lang/wgsl/ast/workgroup_attribute_test.cc",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_unittests_ast_helper",
":libtint_utils_src",
]
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
# This AST test relies on the WGSL reader and writer
sources += [ "lang/wgsl/ast/module_clone_test.cc" ]
}
}
tint_unittests_source_set("tint_unittests_builtins_src") {
sources = [
"lang/core/access_test.cc",
"lang/core/address_space_test.cc",
"lang/core/attribute_test.cc",
"lang/core/builtin_test.cc",
"lang/core/builtin_value_test.cc",
"lang/core/diagnostic_rule_test.cc",
"lang/core/diagnostic_severity_test.cc",
"lang/core/extension_test.cc",
"lang/core/interpolation_sampling_test.cc",
"lang/core/interpolation_type_test.cc",
"lang/core/number_test.cc",
"lang/core/texel_format_test.cc",
]
deps = [ ":libtint_builtins_src" ]
}
tint_unittests_source_set("tint_unittests_diagnostic_src") {
sources = [
"utils/diagnostic/diagnostic_test.cc",
"utils/diagnostic/formatter_test.cc",
"utils/diagnostic/printer_test.cc",
]
}
tint_unittests_source_set("tint_unittests_inspector_src") {
sources = [
"lang/wgsl/inspector/inspector_builder_test.cc",
"lang/wgsl/inspector/inspector_builder_test.h",
"lang/wgsl/inspector/inspector_runner_test.cc",
"lang/wgsl/inspector/inspector_runner_test.h",
"lang/wgsl/inspector/inspector_test.cc",
]
deps = [ ":libtint_inspector_src" ]
}
tint_unittests_source_set("tint_unittests_resolver_src") {
sources = [
"lang/core/constant/eval_binary_op_test.cc",
"lang/core/constant/eval_bitcast_test.cc",
"lang/core/constant/eval_builtin_test.cc",
"lang/core/constant/eval_construction_test.cc",
"lang/core/constant/eval_conversion_test.cc",
"lang/core/constant/eval_indexing_test.cc",
"lang/core/constant/eval_member_access_test.cc",
"lang/core/constant/eval_runtime_semantics_test.cc",
"lang/core/constant/eval_test.h",
"lang/core/constant/eval_unary_op_test.cc",
"lang/core/intrinsic/table_test.cc",
"lang/wgsl/resolver/address_space_layout_validation_test.cc",
"lang/wgsl/resolver/address_space_validation_test.cc",
"lang/wgsl/resolver/alias_analysis_test.cc",
"lang/wgsl/resolver/array_accessor_test.cc",
"lang/wgsl/resolver/assignment_validation_test.cc",
"lang/wgsl/resolver/atomics_test.cc",
"lang/wgsl/resolver/atomics_validation_test.cc",
"lang/wgsl/resolver/attribute_validation_test.cc",
"lang/wgsl/resolver/bitcast_validation_test.cc",
"lang/wgsl/resolver/builtin_enum_test.cc",
"lang/wgsl/resolver/builtin_structs_test.cc",
"lang/wgsl/resolver/builtin_test.cc",
"lang/wgsl/resolver/builtin_validation_test.cc",
"lang/wgsl/resolver/builtins_validation_test.cc",
"lang/wgsl/resolver/call_test.cc",
"lang/wgsl/resolver/call_validation_test.cc",
"lang/wgsl/resolver/compound_assignment_validation_test.cc",
"lang/wgsl/resolver/compound_statement_test.cc",
"lang/wgsl/resolver/const_assert_test.cc",
"lang/wgsl/resolver/control_block_validation_test.cc",
"lang/wgsl/resolver/dependency_graph_test.cc",
"lang/wgsl/resolver/diagnostic_control_test.cc",
"lang/wgsl/resolver/dual_source_blending_extension_test.cc",
"lang/wgsl/resolver/entry_point_validation_test.cc",
"lang/wgsl/resolver/evaluation_stage_test.cc",
"lang/wgsl/resolver/expression_kind_test.cc",
"lang/wgsl/resolver/f16_extension_test.cc",
"lang/wgsl/resolver/function_validation_test.cc",
"lang/wgsl/resolver/host_shareable_validation_test.cc",
"lang/wgsl/resolver/increment_decrement_validation_test.cc",
"lang/wgsl/resolver/inferred_type_test.cc",
"lang/wgsl/resolver/is_host_shareable_test.cc",
"lang/wgsl/resolver/is_storeable_test.cc",
"lang/wgsl/resolver/load_test.cc",
"lang/wgsl/resolver/materialize_test.cc",
"lang/wgsl/resolver/override_test.cc",
"lang/wgsl/resolver/ptr_ref_test.cc",
"lang/wgsl/resolver/ptr_ref_validation_test.cc",
"lang/wgsl/resolver/resolver_behavior_test.cc",
"lang/wgsl/resolver/resolver_helper_test.cc",
"lang/wgsl/resolver/resolver_helper_test.h",
"lang/wgsl/resolver/resolver_test.cc",
"lang/wgsl/resolver/root_identifier_test.cc",
"lang/wgsl/resolver/side_effects_test.cc",
"lang/wgsl/resolver/struct_address_space_use_test.cc",
"lang/wgsl/resolver/struct_layout_test.cc",
"lang/wgsl/resolver/struct_pipeline_stage_use_test.cc",
"lang/wgsl/resolver/subgroups_extension_test.cc",
"lang/wgsl/resolver/type_validation_test.cc",
"lang/wgsl/resolver/uniformity_test.cc",
"lang/wgsl/resolver/unresolved_identifier_test.cc",
"lang/wgsl/resolver/validation_test.cc",
"lang/wgsl/resolver/validator_is_storeable_test.cc",
"lang/wgsl/resolver/value_constructor_validation_test.cc",
"lang/wgsl/resolver/variable_test.cc",
"lang/wgsl/resolver/variable_validation_test.cc",
]
deps = [
":libtint_builtins_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
}
tint_unittests_source_set("tint_unittests_sem_src") {
sources = [
"lang/wgsl/sem/builtin_test.cc",
"lang/wgsl/sem/diagnostic_severity_test.cc",
"lang/wgsl/sem/struct_test.cc",
"lang/wgsl/sem/value_expression_test.cc",
]
}
tint_unittests_source_set("tint_unittests_constant_src") {
sources = [
"lang/core/constant/composite_test.cc",
"lang/core/constant/manager_test.cc",
"lang/core/constant/scalar_test.cc",
"lang/core/constant/splat_test.cc",
"lang/core/constant/value_test.cc",
]
}
tint_unittests_source_set("tint_unittests_type_src") {
sources = [
"lang/core/type/atomic_test.cc",
"lang/core/type/bool_test.cc",
"lang/core/type/builtin_structs_test.cc",
"lang/core/type/depth_multisampled_texture_test.cc",
"lang/core/type/depth_texture_test.cc",
"lang/core/type/external_texture_test.cc",
"lang/core/type/f16_test.cc",
"lang/core/type/f32_test.cc",
"lang/core/type/i32_test.cc",
"lang/core/type/manager_test.cc",
"lang/core/type/matrix_test.cc",
"lang/core/type/multisampled_texture_test.cc",
"lang/core/type/pointer_test.cc",
"lang/core/type/reference_test.cc",
"lang/core/type/sampled_texture_test.cc",
"lang/core/type/sampler_test.cc",
"lang/core/type/storage_texture_test.cc",
"lang/core/type/struct_test.cc",
"lang/core/type/texture_test.cc",
"lang/core/type/type_test.cc",
"lang/core/type/u32_test.cc",
"lang/core/type/vector_test.cc",
]
deps = [ ":libtint_builtins_src" ]
}
tint_unittests_source_set("tint_unittests_ast_transform_src") {
sources = [
"lang/wgsl/ast/transform/add_block_attribute_test.cc",
"lang/wgsl/ast/transform/add_empty_entry_point_test.cc",
"lang/wgsl/ast/transform/array_length_from_uniform_test.cc",
"lang/wgsl/ast/transform/binding_remapper_test.cc",
"lang/wgsl/ast/transform/builtin_polyfill_test.cc",
"lang/wgsl/ast/transform/calculate_array_length_test.cc",
"lang/wgsl/ast/transform/canonicalize_entry_point_io_test.cc",
"lang/wgsl/ast/transform/clamp_frag_depth_test.cc",
"lang/wgsl/ast/transform/combine_samplers_test.cc",
"lang/wgsl/ast/transform/decompose_memory_access_test.cc",
"lang/wgsl/ast/transform/decompose_strided_array_test.cc",
"lang/wgsl/ast/transform/decompose_strided_matrix_test.cc",
"lang/wgsl/ast/transform/demote_to_helper_test.cc",
"lang/wgsl/ast/transform/direct_variable_access_test.cc",
"lang/wgsl/ast/transform/disable_uniformity_analysis_test.cc",
"lang/wgsl/ast/transform/expand_compound_assignment_test.cc",
"lang/wgsl/ast/transform/first_index_offset_test.cc",
"lang/wgsl/ast/transform/fold_trivial_lets_test.cc",
"lang/wgsl/ast/transform/for_loop_to_loop_test.cc",
"lang/wgsl/ast/transform/get_insertion_point_test.cc",
"lang/wgsl/ast/transform/helper_test.h",
"lang/wgsl/ast/transform/hoist_to_decl_before_test.cc",
"lang/wgsl/ast/transform/localize_struct_array_assignment_test.cc",
"lang/wgsl/ast/transform/manager_test.cc",
"lang/wgsl/ast/transform/merge_return_test.cc",
"lang/wgsl/ast/transform/module_scope_var_to_entry_point_param_test.cc",
"lang/wgsl/ast/transform/multiplanar_external_texture_test.cc",
"lang/wgsl/ast/transform/num_workgroups_from_uniform_test.cc",
"lang/wgsl/ast/transform/packed_vec3_test.cc",
"lang/wgsl/ast/transform/pad_structs_test.cc",
"lang/wgsl/ast/transform/preserve_padding_test.cc",
"lang/wgsl/ast/transform/promote_initializers_to_let_test.cc",
"lang/wgsl/ast/transform/promote_side_effects_to_decl_test.cc",
"lang/wgsl/ast/transform/remove_continue_in_switch_test.cc",
"lang/wgsl/ast/transform/remove_phonies_test.cc",
"lang/wgsl/ast/transform/remove_unreachable_statements_test.cc",
"lang/wgsl/ast/transform/renamer_test.cc",
"lang/wgsl/ast/transform/robustness_test.cc",
"lang/wgsl/ast/transform/simplify_pointers_test.cc",
"lang/wgsl/ast/transform/single_entry_point_test.cc",
"lang/wgsl/ast/transform/spirv_atomic_test.cc",
"lang/wgsl/ast/transform/std140_exhaustive_test.cc",
"lang/wgsl/ast/transform/std140_f16_test.cc",
"lang/wgsl/ast/transform/std140_f32_test.cc",
"lang/wgsl/ast/transform/std140_test.cc",
"lang/wgsl/ast/transform/substitute_override_test.cc",
"lang/wgsl/ast/transform/texture_1d_to_2d_test.cc",
"lang/wgsl/ast/transform/transform_test.cc",
"lang/wgsl/ast/transform/truncate_interstage_variables_test.cc",
"lang/wgsl/ast/transform/unshadow_test.cc",
"lang/wgsl/ast/transform/var_for_dynamic_index_test.cc",
"lang/wgsl/ast/transform/vectorize_matrix_conversions_test.cc",
"lang/wgsl/ast/transform/vectorize_scalar_matrix_initializers_test.cc",
"lang/wgsl/ast/transform/vertex_pulling_test.cc",
"lang/wgsl/ast/transform/while_to_loop_test.cc",
"lang/wgsl/ast/transform/zero_init_workgroup_memory_test.cc",
]
deps = [
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_unittests_ast_helper",
":libtint_utils_src",
":libtint_wgsl_reader_src",
":libtint_wgsl_writer_src",
]
}
if (tint_build_ir) {
tint_unittests_source_set("tint_unittests_ir_transform_src") {
sources = [
"lang/core/ir/transform/add_empty_entry_point_test.cc",
"lang/core/ir/transform/bgra8unorm_polyfill_test.cc",
"lang/core/ir/transform/binding_remapper_test.cc",
"lang/core/ir/transform/block_decorated_structs_test.cc",
"lang/core/ir/transform/builtin_polyfill_test.cc",
"lang/core/ir/transform/demote_to_helper_test.cc",
"lang/core/ir/transform/helper_test.h",
"lang/core/ir/transform/std140_test.cc",
]
deps = [
":libtint_ir_src",
":libtint_ir_transform_src",
]
}
}
tint_unittests_source_set("tint_unittests_utils_src") {
sources = [
"utils/cli/cli_test.cc",
"utils/command/command_test.cc",
"utils/containers/bitset_test.cc",
"utils/containers/enum_set_test.cc",
"utils/containers/hashmap_test.cc",
"utils/containers/hashset_test.cc",
"utils/containers/map_test.cc",
"utils/containers/predicates_test.cc",
"utils/containers/reverse_test.cc",
"utils/containers/slice_test.cc",
"utils/containers/transform_test.cc",
"utils/containers/unique_allocator_test.cc",
"utils/containers/unique_vector_test.cc",
"utils/containers/vector_test.cc",
"utils/diagnostic/source_test.cc",
"utils/file/tmpfile_test.cc",
"utils/ice/ice_test.cc",
"utils/macros/defer_test.cc",
"utils/macros/scoped_assignment_test.cc",
"utils/math/crc32_test.cc",
"utils/math/hash_test.cc",
"utils/math/math_test.cc",
"utils/memory/bitcast_test.cc",
"utils/memory/block_allocator_test.cc",
"utils/memory/bump_allocator_test.cc",
"utils/result/result_test.cc",
"utils/rtti/castable_test.cc",
"utils/rtti/switch_test.cc",
"utils/text/string_stream_test.cc",
"utils/text/string_test.cc",
"utils/text/unicode_test.cc",
"utils/traits/traits_test.cc",
]
deps = [ ":libtint_utils_src" ]
}
tint_unittests_source_set("tint_unittests_writer_src") {
sources = [
"lang/wgsl/helpers/append_vector_test.cc",
"lang/wgsl/helpers/check_supported_extensions_test.cc",
"lang/wgsl/helpers/flatten_bindings_test.cc",
"utils/strconv/float_to_string_test.cc",
]
deps = [
":libtint_unittests_ast_helper",
":libtint_utils_src",
":libtint_writer_src",
]
}
# Note, this includes the source files along with the test as otherwise the cmd helpers wouldn't
# be included in the binary.
tint_unittests_source_set("tint_unittests_cmd_src") {
sources = [
"cmd/common/generate_external_texture_bindings.cc",
"cmd/common/generate_external_texture_bindings.h",
"cmd/common/generate_external_texture_bindings_test.cc",
]
}
tint_unittests_source_set("tint_unittests_spv_reader_src") {
sources = [
"lang/spirv/reader/ast_parser/ast_parser_test.cc",
"lang/spirv/reader/ast_parser/barrier_test.cc",
"lang/spirv/reader/ast_parser/constant_test.cc",
"lang/spirv/reader/ast_parser/convert_member_decoration_test.cc",
"lang/spirv/reader/ast_parser/convert_type_test.cc",
"lang/spirv/reader/ast_parser/enum_converter_test.cc",
"lang/spirv/reader/ast_parser/fail_stream_test.cc",
"lang/spirv/reader/ast_parser/function_arithmetic_test.cc",
"lang/spirv/reader/ast_parser/function_bit_test.cc",
"lang/spirv/reader/ast_parser/function_call_test.cc",
"lang/spirv/reader/ast_parser/function_cfg_test.cc",
"lang/spirv/reader/ast_parser/function_composite_test.cc",
"lang/spirv/reader/ast_parser/function_conversion_test.cc",
"lang/spirv/reader/ast_parser/function_decl_test.cc",
"lang/spirv/reader/ast_parser/function_glsl_std_450_test.cc",
"lang/spirv/reader/ast_parser/function_logical_test.cc",
"lang/spirv/reader/ast_parser/function_memory_test.cc",
"lang/spirv/reader/ast_parser/function_misc_test.cc",
"lang/spirv/reader/ast_parser/function_var_test.cc",
"lang/spirv/reader/ast_parser/get_decorations_test.cc",
"lang/spirv/reader/ast_parser/handle_test.cc",
"lang/spirv/reader/ast_parser/helper_test.cc",
"lang/spirv/reader/ast_parser/helper_test.h",
"lang/spirv/reader/ast_parser/import_test.cc",
"lang/spirv/reader/ast_parser/module_function_decl_test.cc",
"lang/spirv/reader/ast_parser/module_var_test.cc",
"lang/spirv/reader/ast_parser/named_types_test.cc",
"lang/spirv/reader/ast_parser/namer_test.cc",
"lang/spirv/reader/ast_parser/spirv_tools_helpers_test.cc",
"lang/spirv/reader/ast_parser/spirv_tools_helpers_test.h",
"lang/spirv/reader/ast_parser/type_test.cc",
"lang/spirv/reader/ast_parser/usage_test.cc",
"lang/spirv/reader/ast_parser/user_name_test.cc",
]
deps = [
":libtint_builtins_src",
":libtint_spv_reader_src",
":libtint_wgsl_writer_src",
"${tint_spirv_tools_dir}/:spvtools_opt",
]
}
tint_unittests_source_set("tint_unittests_spv_writer_src") {
sources = [
"lang/spirv/writer/ast_printer/accessor_expression_test.cc",
"lang/spirv/writer/ast_printer/assign_test.cc",
"lang/spirv/writer/ast_printer/ast_builtin_test.cc",
"lang/spirv/writer/ast_printer/ast_discard_test.cc",
"lang/spirv/writer/ast_printer/ast_function_test.cc",
"lang/spirv/writer/ast_printer/ast_if_test.cc",
"lang/spirv/writer/ast_printer/ast_loop_test.cc",
"lang/spirv/writer/ast_printer/ast_printer_test.cc",
"lang/spirv/writer/ast_printer/ast_switch_test.cc",
"lang/spirv/writer/ast_printer/ast_type_test.cc",
"lang/spirv/writer/ast_printer/binary_expression_test.cc",
"lang/spirv/writer/ast_printer/bitcast_expression_test.cc",
"lang/spirv/writer/ast_printer/block_test.cc",
"lang/spirv/writer/ast_printer/builtin_texture_test.cc",
"lang/spirv/writer/ast_printer/call_test.cc",
"lang/spirv/writer/ast_printer/const_assert_test.cc",
"lang/spirv/writer/ast_printer/constructor_expression_test.cc",
"lang/spirv/writer/ast_printer/entry_point_test.cc",
"lang/spirv/writer/ast_printer/format_conversion_test.cc",
"lang/spirv/writer/ast_printer/function_attribute_test.cc",
"lang/spirv/writer/ast_printer/function_variable_test.cc",
"lang/spirv/writer/ast_printer/global_variable_test.cc",
"lang/spirv/writer/ast_printer/helper_test.h",
"lang/spirv/writer/ast_printer/ident_expression_test.cc",
"lang/spirv/writer/ast_printer/literal_test.cc",
"lang/spirv/writer/ast_printer/return_test.cc",
"lang/spirv/writer/ast_printer/scalar_constant_test.cc",
"lang/spirv/writer/ast_printer/unary_op_expression_test.cc",
"lang/spirv/writer/common/binary_writer_test.cc",
"lang/spirv/writer/common/instruction_test.cc",
"lang/spirv/writer/common/module_test.cc",
"lang/spirv/writer/common/operand_test.cc",
"lang/spirv/writer/common/spv_dump.cc",
"lang/spirv/writer/common/spv_dump.h",
]
deps = [
":libtint_builtins_src",
":libtint_spv_writer_src",
":libtint_utils_src",
":tint_unittests_ast_src",
"${tint_spirv_tools_dir}/:spvtools",
]
if (tint_build_ir) {
sources += [
"lang/spirv/writer/access_test.cc",
"lang/spirv/writer/atomic_builtin_test.cc",
"lang/spirv/writer/binary_test.cc",
"lang/spirv/writer/bitcast_test.cc",
"lang/spirv/writer/builtin_test.cc",
"lang/spirv/writer/common/helper_test.h",
"lang/spirv/writer/constant_test.cc",
"lang/spirv/writer/construct_test.cc",
"lang/spirv/writer/convert_test.cc",
"lang/spirv/writer/discard_test.cc",
"lang/spirv/writer/function_test.cc",
"lang/spirv/writer/if_test.cc",
"lang/spirv/writer/let_test.cc",
"lang/spirv/writer/loop_test.cc",
"lang/spirv/writer/raise/builtin_polyfill_test.cc",
"lang/spirv/writer/raise/expand_implicit_splats_test.cc",
"lang/spirv/writer/raise/handle_matrix_arithmetic_test.cc",
"lang/spirv/writer/raise/merge_return_test.cc",
"lang/spirv/writer/raise/shader_io_test.cc",
"lang/spirv/writer/raise/var_for_dynamic_index_test.cc",
"lang/spirv/writer/switch_test.cc",
"lang/spirv/writer/swizzle_test.cc",
"lang/spirv/writer/texture_builtin_test.cc",
"lang/spirv/writer/type_test.cc",
"lang/spirv/writer/unary_test.cc",
"lang/spirv/writer/var_test.cc",
"lang/spirv/writer/writer_test.cc",
]
deps += [
":libtint_ir_src",
":tint_unittests_ir_transform_src",
]
}
}
tint_unittests_source_set("tint_unittests_wgsl_reader_src") {
sources = [
"lang/wgsl/reader/parser/additive_expression_test.cc",
"lang/wgsl/reader/parser/argument_expression_list_test.cc",
"lang/wgsl/reader/parser/assignment_stmt_test.cc",
"lang/wgsl/reader/parser/bitwise_expression_test.cc",
"lang/wgsl/reader/parser/break_stmt_test.cc",
"lang/wgsl/reader/parser/bug_cases_test.cc",
"lang/wgsl/reader/parser/call_stmt_test.cc",
"lang/wgsl/reader/parser/classify_template_args_test.cc",
"lang/wgsl/reader/parser/compound_stmt_test.cc",
"lang/wgsl/reader/parser/const_literal_test.cc",
"lang/wgsl/reader/parser/continue_stmt_test.cc",
"lang/wgsl/reader/parser/continuing_stmt_test.cc",
"lang/wgsl/reader/parser/core_lhs_expression_test.cc",
"lang/wgsl/reader/parser/diagnostic_attribute_test.cc",
"lang/wgsl/reader/parser/diagnostic_control_test.cc",
"lang/wgsl/reader/parser/diagnostic_directive_test.cc",
"lang/wgsl/reader/parser/enable_directive_test.cc",
"lang/wgsl/reader/parser/error_msg_test.cc",
"lang/wgsl/reader/parser/error_resync_test.cc",
"lang/wgsl/reader/parser/expression_test.cc",
"lang/wgsl/reader/parser/for_stmt_test.cc",
"lang/wgsl/reader/parser/function_attribute_list_test.cc",
"lang/wgsl/reader/parser/function_attribute_test.cc",
"lang/wgsl/reader/parser/function_decl_test.cc",
"lang/wgsl/reader/parser/function_header_test.cc",
"lang/wgsl/reader/parser/global_constant_decl_test.cc",
"lang/wgsl/reader/parser/global_decl_test.cc",
"lang/wgsl/reader/parser/global_variable_decl_test.cc",
"lang/wgsl/reader/parser/helper_test.cc",
"lang/wgsl/reader/parser/helper_test.h",
"lang/wgsl/reader/parser/if_stmt_test.cc",
"lang/wgsl/reader/parser/increment_decrement_stmt_test.cc",
"lang/wgsl/reader/parser/lexer_test.cc",
"lang/wgsl/reader/parser/lhs_expression_test.cc",
"lang/wgsl/reader/parser/loop_stmt_test.cc",
"lang/wgsl/reader/parser/math_expression_test.cc",
"lang/wgsl/reader/parser/multiplicative_expression_test.cc",
"lang/wgsl/reader/parser/param_list_test.cc",
"lang/wgsl/reader/parser/paren_expression_test.cc",
"lang/wgsl/reader/parser/parser_test.cc",
"lang/wgsl/reader/parser/primary_expression_test.cc",
"lang/wgsl/reader/parser/relational_expression_test.cc",
"lang/wgsl/reader/parser/require_directive_test.cc",
"lang/wgsl/reader/parser/reserved_keyword_test.cc",
"lang/wgsl/reader/parser/shift_expression_test.cc",
"lang/wgsl/reader/parser/singular_expression_test.cc",
"lang/wgsl/reader/parser/statement_test.cc",
"lang/wgsl/reader/parser/statements_test.cc",
"lang/wgsl/reader/parser/struct_attribute_decl_test.cc",
"lang/wgsl/reader/parser/struct_body_decl_test.cc",
"lang/wgsl/reader/parser/struct_decl_test.cc",
"lang/wgsl/reader/parser/struct_member_attribute_decl_test.cc",
"lang/wgsl/reader/parser/struct_member_attribute_test.cc",
"lang/wgsl/reader/parser/struct_member_test.cc",
"lang/wgsl/reader/parser/switch_body_test.cc",
"lang/wgsl/reader/parser/switch_stmt_test.cc",
"lang/wgsl/reader/parser/token_test.cc",
"lang/wgsl/reader/parser/type_alias_test.cc",
"lang/wgsl/reader/parser/type_decl_test.cc",
"lang/wgsl/reader/parser/unary_expression_test.cc",
"lang/wgsl/reader/parser/variable_attribute_list_test.cc",
"lang/wgsl/reader/parser/variable_attribute_test.cc",
"lang/wgsl/reader/parser/variable_decl_test.cc",
"lang/wgsl/reader/parser/variable_ident_decl_test.cc",
"lang/wgsl/reader/parser/variable_qualifier_test.cc",
"lang/wgsl/reader/parser/variable_stmt_test.cc",
"lang/wgsl/reader/parser/while_stmt_test.cc",
]
deps = [
":libtint_builtins_src",
":libtint_unittests_ast_helper",
":libtint_wgsl_reader_src",
]
}
tint_unittests_source_set("tint_unittests_wgsl_reader_program_to_ir_src") {
sources = []
deps = []
if (tint_build_ir) {
sources += [
"lang/wgsl/reader/program_to_ir/accessor_test.cc",
"lang/wgsl/reader/program_to_ir/binary_test.cc",
"lang/wgsl/reader/program_to_ir/builtin_test.cc",
"lang/wgsl/reader/program_to_ir/call_test.cc",
"lang/wgsl/reader/program_to_ir/function_test.cc",
"lang/wgsl/reader/program_to_ir/let_test.cc",
"lang/wgsl/reader/program_to_ir/literal_test.cc",
"lang/wgsl/reader/program_to_ir/materialize_test.cc",
"lang/wgsl/reader/program_to_ir/program_to_ir_test.cc",
"lang/wgsl/reader/program_to_ir/shadowing_test.cc",
"lang/wgsl/reader/program_to_ir/store_test.cc",
"lang/wgsl/reader/program_to_ir/unary_test.cc",
"lang/wgsl/reader/program_to_ir/var_test.cc",
]
deps += [
":libtint_ir_src",
":tint_unittests_ir_src",
":tint_unittests_wgsl_ir_helper",
]
}
}
tint_unittests_source_set("tint_unittests_wgsl_writer_ir_to_program_src") {
sources = []
deps = []
if (tint_build_ir) {
sources += [
"lang/wgsl/writer/ir_to_program/inlining_test.cc",
"lang/wgsl/writer/ir_to_program/ir_to_program_test.cc",
"lang/wgsl/writer/ir_to_program/ir_to_program_test.h",
"lang/wgsl/writer/ir_to_program/rename_conflicts_test.cc",
]
deps += [
":libtint_ir_src",
":tint_unittests_ir_src",
]
}
}
tint_unittests_source_set("tint_unittests_wgsl_ir_roundtrip_src") {
sources = []
deps = []
if (tint_build_ir) {
sources += [ "lang/wgsl/ir_roundtrip_test.cc" ]
deps += [
":libtint_ir_src",
":libtint_wgsl_reader_program_to_ir_src",
":tint_unittests_ir_src",
":tint_unittests_wgsl_ir_helper",
]
}
}
tint_unittests_source_set("tint_unittests_wgsl_writer_src") {
sources = [
"lang/wgsl/writer/ast_printer/alias_type_test.cc",
"lang/wgsl/writer/ast_printer/array_accessor_test.cc",
"lang/wgsl/writer/ast_printer/assign_test.cc",
"lang/wgsl/writer/ast_printer/ast_printer_test.cc",
"lang/wgsl/writer/ast_printer/binary_test.cc",
"lang/wgsl/writer/ast_printer/bitcast_test.cc",
"lang/wgsl/writer/ast_printer/block_test.cc",
"lang/wgsl/writer/ast_printer/break_test.cc",
"lang/wgsl/writer/ast_printer/call_test.cc",
"lang/wgsl/writer/ast_printer/case_test.cc",
"lang/wgsl/writer/ast_printer/cast_test.cc",
"lang/wgsl/writer/ast_printer/const_assert_test.cc",
"lang/wgsl/writer/ast_printer/constructor_test.cc",
"lang/wgsl/writer/ast_printer/continue_test.cc",
"lang/wgsl/writer/ast_printer/diagnostic_test.cc",
"lang/wgsl/writer/ast_printer/discard_test.cc",
"lang/wgsl/writer/ast_printer/enable_test.cc",
"lang/wgsl/writer/ast_printer/function_test.cc",
"lang/wgsl/writer/ast_printer/global_decl_test.cc",
"lang/wgsl/writer/ast_printer/helper_test.h",
"lang/wgsl/writer/ast_printer/identifier_test.cc",
"lang/wgsl/writer/ast_printer/if_test.cc",
"lang/wgsl/writer/ast_printer/literal_test.cc",
"lang/wgsl/writer/ast_printer/loop_test.cc",
"lang/wgsl/writer/ast_printer/member_accessor_test.cc",
"lang/wgsl/writer/ast_printer/return_test.cc",
"lang/wgsl/writer/ast_printer/switch_test.cc",
"lang/wgsl/writer/ast_printer/type_test.cc",
"lang/wgsl/writer/ast_printer/unary_op_test.cc",
"lang/wgsl/writer/ast_printer/variable_decl_statement_test.cc",
"lang/wgsl/writer/ast_printer/variable_test.cc",
]
deps = [
":libtint_builtins_src",
":libtint_utils_src",
":libtint_wgsl_writer_src",
":tint_unittests_ast_src",
]
}
tint_unittests_source_set("tint_unittests_msl_writer_ast_printer_src") {
sources = [
"lang/msl/writer/ast_printer/array_accessor_test.cc",
"lang/msl/writer/ast_printer/assign_test.cc",
"lang/msl/writer/ast_printer/ast_function_test.cc",
"lang/msl/writer/ast_printer/ast_printer_test.cc",
"lang/msl/writer/ast_printer/ast_type_test.cc",
"lang/msl/writer/ast_printer/binary_test.cc",
"lang/msl/writer/ast_printer/bitcast_test.cc",
"lang/msl/writer/ast_printer/block_test.cc",
"lang/msl/writer/ast_printer/break_test.cc",
"lang/msl/writer/ast_printer/builtin_test.cc",
"lang/msl/writer/ast_printer/builtin_texture_test.cc",
"lang/msl/writer/ast_printer/call_test.cc",
"lang/msl/writer/ast_printer/case_test.cc",
"lang/msl/writer/ast_printer/cast_test.cc",
"lang/msl/writer/ast_printer/const_assert_test.cc",
"lang/msl/writer/ast_printer/constructor_test.cc",
"lang/msl/writer/ast_printer/continue_test.cc",
"lang/msl/writer/ast_printer/discard_test.cc",
"lang/msl/writer/ast_printer/helper_test.h",
"lang/msl/writer/ast_printer/identifier_test.cc",
"lang/msl/writer/ast_printer/if_test.cc",
"lang/msl/writer/ast_printer/import_test.cc",
"lang/msl/writer/ast_printer/loop_test.cc",
"lang/msl/writer/ast_printer/member_accessor_test.cc",
"lang/msl/writer/ast_printer/module_constant_test.cc",
"lang/msl/writer/ast_printer/return_test.cc",
"lang/msl/writer/ast_printer/sanitizer_test.cc",
"lang/msl/writer/ast_printer/switch_test.cc",
"lang/msl/writer/ast_printer/unary_op_test.cc",
"lang/msl/writer/ast_printer/variable_decl_statement_test.cc",
"lang/msl/writer/common/printer_support_test.cc",
]
deps = [
":libtint_msl_writer_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
}
tint_unittests_source_set("tint_unittests_msl_writer_printer_src") {
sources = []
deps = [
":libtint_msl_writer_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
if (tint_build_ir) {
sources += [
"lang/msl/writer/printer/binary_test.cc",
"lang/msl/writer/printer/constant_test.cc",
"lang/msl/writer/printer/function_test.cc",
"lang/msl/writer/printer/helper_test.h",
"lang/msl/writer/printer/if_test.cc",
"lang/msl/writer/printer/let_test.cc",
"lang/msl/writer/printer/return_test.cc",
"lang/msl/writer/printer/type_test.cc",
"lang/msl/writer/printer/var_test.cc",
]
deps += [
":libtint_ir_src",
":libtint_msl_writer_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
}
}
tint_unittests_source_set("tint_unittests_hlsl_writer_src") {
sources = [
"lang/hlsl/writer/ast_printer/array_accessor_test.cc",
"lang/hlsl/writer/ast_printer/assign_test.cc",
"lang/hlsl/writer/ast_printer/ast_printer_test.cc",
"lang/hlsl/writer/ast_printer/binary_test.cc",
"lang/hlsl/writer/ast_printer/bitcast_test.cc",
"lang/hlsl/writer/ast_printer/block_test.cc",
"lang/hlsl/writer/ast_printer/break_test.cc",
"lang/hlsl/writer/ast_printer/builtin_test.cc",
"lang/hlsl/writer/ast_printer/builtin_texture_test.cc",
"lang/hlsl/writer/ast_printer/call_test.cc",
"lang/hlsl/writer/ast_printer/case_test.cc",
"lang/hlsl/writer/ast_printer/cast_test.cc",
"lang/hlsl/writer/ast_printer/const_assert_test.cc",
"lang/hlsl/writer/ast_printer/constructor_test.cc",
"lang/hlsl/writer/ast_printer/continue_test.cc",
"lang/hlsl/writer/ast_printer/discard_test.cc",
"lang/hlsl/writer/ast_printer/function_test.cc",
"lang/hlsl/writer/ast_printer/helper_test.h",
"lang/hlsl/writer/ast_printer/identifier_test.cc",
"lang/hlsl/writer/ast_printer/if_test.cc",
"lang/hlsl/writer/ast_printer/import_test.cc",
"lang/hlsl/writer/ast_printer/loop_test.cc",
"lang/hlsl/writer/ast_printer/member_accessor_test.cc",
"lang/hlsl/writer/ast_printer/module_constant_test.cc",
"lang/hlsl/writer/ast_printer/return_test.cc",
"lang/hlsl/writer/ast_printer/sanitizer_test.cc",
"lang/hlsl/writer/ast_printer/switch_test.cc",
"lang/hlsl/writer/ast_printer/type_test.cc",
"lang/hlsl/writer/ast_printer/unary_op_test.cc",
"lang/hlsl/writer/ast_printer/variable_decl_statement_test.cc",
"lang/hlsl/writer/ast_printer/workgroup_var_test.cc",
]
deps = [
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_hlsl_writer_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
}
tint_unittests_source_set("tint_unittests_glsl_writer_src") {
sources = [
"lang/glsl/writer/ast_printer/array_accessor_test.cc",
"lang/glsl/writer/ast_printer/assign_test.cc",
"lang/glsl/writer/ast_printer/ast_printer_test.cc",
"lang/glsl/writer/ast_printer/binary_test.cc",
"lang/glsl/writer/ast_printer/bitcast_test.cc",
"lang/glsl/writer/ast_printer/block_test.cc",
"lang/glsl/writer/ast_printer/break_test.cc",
"lang/glsl/writer/ast_printer/builtin_test.cc",
"lang/glsl/writer/ast_printer/builtin_texture_test.cc",
"lang/glsl/writer/ast_printer/call_test.cc",
"lang/glsl/writer/ast_printer/case_test.cc",
"lang/glsl/writer/ast_printer/cast_test.cc",
"lang/glsl/writer/ast_printer/constructor_test.cc",
"lang/glsl/writer/ast_printer/continue_test.cc",
"lang/glsl/writer/ast_printer/discard_test.cc",
"lang/glsl/writer/ast_printer/function_test.cc",
"lang/glsl/writer/ast_printer/helper_test.h",
"lang/glsl/writer/ast_printer/identifier_test.cc",
"lang/glsl/writer/ast_printer/if_test.cc",
"lang/glsl/writer/ast_printer/import_test.cc",
"lang/glsl/writer/ast_printer/loop_test.cc",
"lang/glsl/writer/ast_printer/member_accessor_test.cc",
"lang/glsl/writer/ast_printer/module_constant_test.cc",
"lang/glsl/writer/ast_printer/return_test.cc",
"lang/glsl/writer/ast_printer/sanitizer_test.cc",
"lang/glsl/writer/ast_printer/storage_buffer_test.cc",
"lang/glsl/writer/ast_printer/switch_test.cc",
"lang/glsl/writer/ast_printer/type_test.cc",
"lang/glsl/writer/ast_printer/unary_op_test.cc",
"lang/glsl/writer/ast_printer/uniform_buffer_test.cc",
"lang/glsl/writer/ast_printer/variable_decl_statement_test.cc",
"lang/glsl/writer/ast_printer/workgroup_var_test.cc",
]
deps = [
":libtint_ast_transform_base_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_glsl_writer_src",
":libtint_symbols_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
}
tint_unittests_source_set("tint_unittests_symbols_src") {
sources = [
"utils/containers/scope_stack_test.cc",
"utils/reflection/reflection_test.cc",
"utils/symbol/symbol_table_test.cc",
"utils/symbol/symbol_test.cc",
]
deps = [ ":libtint_symbols_src" ]
}
tint_unittests_source_set("tint_unittests_core_src") {
sources = [
"lang/wgsl/program/clone_context_test.cc",
"lang/wgsl/program/program_builder_test.cc",
"lang/wgsl/program/program_test.cc",
]
deps = [
":libtint_program_src",
":libtint_unittests_ast_helper",
":tint_unittests_ast_src",
]
}
if (tint_build_ir) {
tint_unittests_source_set("tint_unittests_wgsl_ir_helper") {
sources = [ "lang/wgsl/helpers/ir_program_test.h" ]
deps = [
":libtint_builtins_src",
":libtint_ir_src",
":libtint_wgsl_reader_program_to_ir_src",
":libtint_wgsl_writer_ir_to_program_src",
]
}
tint_unittests_source_set("tint_unittests_ir_src") {
sources = [
"lang/core/ir/access_test.cc",
"lang/core/ir/binary_test.cc",
"lang/core/ir/bitcast_test.cc",
"lang/core/ir/block_param_test.cc",
"lang/core/ir/block_test.cc",
"lang/core/ir/break_if_test.cc",
"lang/core/ir/constant_test.cc",
"lang/core/ir/construct_test.cc",
"lang/core/ir/continue_test.cc",
"lang/core/ir/convert_test.cc",
"lang/core/ir/core_builtin_call_test.cc",
"lang/core/ir/discard_test.cc",
"lang/core/ir/exit_if_test.cc",
"lang/core/ir/exit_loop_test.cc",
"lang/core/ir/exit_switch_test.cc",
"lang/core/ir/function_param_test.cc",
"lang/core/ir/function_test.cc",
"lang/core/ir/if_test.cc",
"lang/core/ir/instruction_result_test.cc",
"lang/core/ir/instruction_test.cc",
"lang/core/ir/intrinsic_call_test.cc",
"lang/core/ir/let_test.cc",
"lang/core/ir/load_test.cc",
"lang/core/ir/load_vector_element_test.cc",
"lang/core/ir/loop_test.cc",
"lang/core/ir/module_test.cc",
"lang/core/ir/multi_in_block_test.cc",
"lang/core/ir/next_iteration_test.cc",
"lang/core/ir/operand_instruction_test.cc",
"lang/core/ir/return_test.cc",
"lang/core/ir/store_test.cc",
"lang/core/ir/store_vector_element_test.cc",
"lang/core/ir/switch_test.cc",
"lang/core/ir/swizzle_test.cc",
"lang/core/ir/unary_test.cc",
"lang/core/ir/user_call_test.cc",
"lang/core/ir/validator_test.cc",
"lang/core/ir/value_test.cc",
"lang/core/ir/var_test.cc",
]
deps = [
":libtint_builtins_src",
":libtint_ir_src",
":libtint_wgsl_reader_program_to_ir_src",
":libtint_wgsl_writer_ir_to_program_src",
]
}
}
if (build_with_chromium) {
tint_unittests_source_set("tint_unittests_fuzzer_src") {
sources = [ "fuzzers/random_generator_test.cc" ]
deps = [
":tint_unittests_core_src",
"fuzzers:tint_fuzzer_common_src",
]
}
}
source_set("tint_unittests_src") {
testonly = true
deps = [
":libtint_wgsl_reader_src",
":libtint_wgsl_writer_src",
":tint_unittests_ast_src",
":tint_unittests_ast_transform_src",
":tint_unittests_builtins_src",
":tint_unittests_cmd_src",
":tint_unittests_constant_src",
":tint_unittests_core_src",
":tint_unittests_diagnostic_src",
":tint_unittests_inspector_src",
":tint_unittests_resolver_src",
":tint_unittests_sem_src",
":tint_unittests_symbols_src",
":tint_unittests_type_src",
":tint_unittests_utils_src",
":tint_unittests_writer_src",
]
if (tint_build_spv_reader) {
deps += [ ":tint_unittests_spv_reader_src" ]
}
if (tint_build_spv_writer) {
deps += [ ":tint_unittests_spv_writer_src" ]
}
if (tint_build_wgsl_reader) {
deps += [ ":tint_unittests_wgsl_reader_src" ]
}
if (tint_build_wgsl_writer) {
deps += [ ":tint_unittests_wgsl_writer_src" ]
}
if (tint_build_msl_writer) {
deps += [
":tint_unittests_msl_writer_ast_printer_src",
":tint_unittests_msl_writer_printer_src",
]
}
if (tint_build_hlsl_writer) {
deps += [ ":tint_unittests_hlsl_writer_src" ]
}
if (tint_build_glsl_writer) {
deps += [ ":tint_unittests_glsl_writer_src" ]
}
if (tint_build_ir) {
deps += [
":tint_unittests_ir_src",
":tint_unittests_ir_transform_src",
]
if (tint_build_wgsl_reader) {
deps += [ ":tint_unittests_wgsl_reader_program_to_ir_src" ]
}
if (tint_build_wgsl_writer) {
deps += [ ":tint_unittests_wgsl_writer_ir_to_program_src" ]
}
if (tint_build_wgsl_reader && tint_build_wgsl_writer) {
deps += [ ":tint_unittests_wgsl_ir_roundtrip_src" ]
}
}
if (build_with_chromium) {
deps += [ ":tint_unittests_fuzzer_src" ]
}
configs += [ ":tint_unittests_config" ]
if (build_with_chromium) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
}
test("tint_unittests") {
deps = [
":gmock_and_gtest",
":tint_unittests_src",
"${tint_spirv_tools_dir}/:spvtools",
"${tint_spirv_tools_dir}/:spvtools_opt",
"${tint_spirv_tools_dir}/:spvtools_val",
]
deps += [ ":tint_unittests_main" ]
configs += [ ":tint_unittests_config" ]
if (build_with_chromium) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
if (is_win && is_debug) {
# TODO(crbug.com/tint/1749): both msvc and clang builds stack overflow on debug builds.
# Increase the initial stack size to 4 MB (default is 1MB).
ldflags = [ "/STACK:4194304" ]
}
testonly = true
}
}