blob: 3e388b000317a1accb6497a9eba5730bb622a460 [file] [log] [blame] [edit]
# 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 = [
"program_id.cc",
"program_id.h",
"utils/containers/scope_stack.h",
"utils/reflection/reflection.h",
"utils/text/symbol.cc",
"utils/text/symbol.h",
"utils/text/symbol_table.cc",
"utils/text/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/debug.cc",
"utils/debug/debug.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/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/text/parse_num.cc",
"utils/text/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 = [ "clone_context.h" ]
deps = [
":libtint_symbols_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_program_src") {
sources = [
"clone_context.cc",
"lang/wgsl/program/program.cc",
"lang/wgsl/program/program_builder.cc",
"lang/wgsl/resolver/const_eval.cc",
"lang/wgsl/resolver/const_eval.h",
"lang/wgsl/resolver/ctor_conv_intrinsic.cc",
"lang/wgsl/resolver/ctor_conv_intrinsic.h",
"lang/wgsl/resolver/dependency_graph.cc",
"lang/wgsl/resolver/dependency_graph.h",
"lang/wgsl/resolver/intrinsic_table.cc",
"lang/wgsl/resolver/intrinsic_table.h",
"lang/wgsl/resolver/intrinsic_table.inl",
"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_transform_src") {
sources = [
"transform/transform.cc",
"transform/transform.h",
]
deps = [ ":libtint_utils_src" ]
}
libtint_source_set("libtint_ast_transform_base_src") {
sources = [
"lang/wgsl/ast/transform/transform.cc",
"lang/wgsl/ast/transform/transform.h",
]
deps = [
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_transform_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_transform_manager_src") {
sources = [
"transform/manager.cc",
"transform/manager.h",
]
deps = [
":libtint_ast_transform_base_src",
":libtint_program_src",
":libtint_transform_src",
]
if (tint_build_ir) {
deps += [
":libtint_ir_builder_src",
":libtint_ir_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/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/utils/get_insertion_point.cc",
"lang/wgsl/ast/transform/utils/get_insertion_point.h",
"lang/wgsl/ast/transform/utils/hoist_to_decl_before.cc",
"lang/wgsl/ast/transform/utils/hoist_to_decl_before.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_transform_manager_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/block_decorated_structs.cc",
"lang/core/ir/transform/block_decorated_structs.h",
"lang/core/ir/transform/demote_to_helper.cc",
"lang/core/ir/transform/demote_to_helper.h",
"lang/core/ir/transform/rename_conflicts_wgsl.cc",
"lang/core/ir/transform/rename_conflicts_wgsl.h",
"lang/core/ir/transform/shader_io.cc",
"lang/core/ir/transform/shader_io.h",
]
deps = [
":libtint_builtins_src",
":libtint_ir_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
if (tint_build_spv_writer) {
sources += [
"lang/core/ir/transform/builtin_polyfill_spirv.cc",
"lang/core/ir/transform/builtin_polyfill_spirv.h",
"lang/core/ir/transform/expand_implicit_splats.cc",
"lang/core/ir/transform/expand_implicit_splats.h",
"lang/core/ir/transform/handle_matrix_arithmetic.cc",
"lang/core/ir/transform/handle_matrix_arithmetic.h",
"lang/core/ir/transform/merge_return.cc",
"lang/core/ir/transform/merge_return.h",
"lang/core/ir/transform/shader_io_spirv.cc",
"lang/core/ir/transform/shader_io_spirv.h",
"lang/core/ir/transform/var_for_dynamic_index.cc",
"lang/core/ir/transform/var_for_dynamic_index.h",
]
}
}
}
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.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/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/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.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/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/binding_point.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/evaluation_stage.h",
"lang/wgsl/sem/expression.cc",
"lang/wgsl/sem/expression.h",
"lang/wgsl/sem/external_texture.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/parameter_usage.cc",
"lang/wgsl/sem/parameter_usage.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/builtin/access.cc",
"lang/core/builtin/access.h",
"lang/core/builtin/address_space.cc",
"lang/core/builtin/address_space.h",
"lang/core/builtin/attribute.cc",
"lang/core/builtin/attribute.h",
"lang/core/builtin/builtin.cc",
"lang/core/builtin/builtin.h",
"lang/core/builtin/builtin_value.cc",
"lang/core/builtin/builtin_value.h",
"lang/core/builtin/diagnostic_rule.cc",
"lang/core/builtin/diagnostic_rule.h",
"lang/core/builtin/diagnostic_severity.cc",
"lang/core/builtin/diagnostic_severity.h",
"lang/core/builtin/extension.cc",
"lang/core/builtin/extension.h",
"lang/core/builtin/fluent_types.h",
"lang/core/builtin/function.cc",
"lang/core/builtin/function.h",
"lang/core/builtin/interpolation.h",
"lang/core/builtin/interpolation_sampling.cc",
"lang/core/builtin/interpolation_sampling.h",
"lang/core/builtin/interpolation_type.cc",
"lang/core/builtin/interpolation_type.h",
"lang/core/builtin/number.cc",
"lang/core/builtin/number.h",
"lang/core/builtin/texel_format.cc",
"lang/core/builtin/texel_format.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_reader_src") {
sources = [
"reader/reader.cc",
"reader/reader.h",
]
public_deps = [ ":libtint_program_src" ]
}
libtint_source_set("libtint_spv_reader_src") {
sources = [
"lang/spirv/reader/attributes.h",
"lang/spirv/reader/construct.cc",
"lang/spirv/reader/construct.h",
"lang/spirv/reader/entry_point_info.cc",
"lang/spirv/reader/entry_point_info.h",
"lang/spirv/reader/enum_converter.cc",
"lang/spirv/reader/enum_converter.h",
"lang/spirv/reader/fail_stream.h",
"lang/spirv/reader/function.cc",
"lang/spirv/reader/function.h",
"lang/spirv/reader/namer.cc",
"lang/spirv/reader/namer.h",
"lang/spirv/reader/parser.cc",
"lang/spirv/reader/parser.h",
"lang/spirv/reader/parser_impl.cc",
"lang/spirv/reader/parser_impl.h",
"lang/spirv/reader/parser_type.cc",
"lang/spirv/reader/parser_type.h",
"lang/spirv/reader/usage.cc",
"lang/spirv/reader/usage.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_reader_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_transform_manager_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/text/float_to_string.cc",
"utils/text/float_to_string.h",
"utils/text/text_generator.cc",
"utils/text/text_generator.h",
"writer/array_length_from_uniform_options.cc",
"writer/array_length_from_uniform_options.h",
"writer/ast_text_generator.cc",
"writer/ast_text_generator.h",
"writer/binding_point.h",
"writer/binding_remapper_options.cc",
"writer/binding_remapper_options.h",
"writer/external_texture_options.cc",
"writer/external_texture_options.h",
"writer/text.cc",
"writer/text.h",
"writer/writer.cc",
"writer/writer.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_inspector_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_transform_manager_src",
":libtint_type_src",
":libtint_utils_src",
]
if (tint_build_ir) {
sources += [
"writer/ir_text_generator.cc",
"writer/ir_text_generator.h",
]
deps += [ ":libtint_ir_src" ]
}
}
libtint_source_set("libtint_spv_writer_src") {
sources = [
"lang/spirv/ast_writer/binary_writer.cc",
"lang/spirv/ast_writer/binary_writer.h",
"lang/spirv/ast_writer/builder.cc",
"lang/spirv/ast_writer/builder.h",
"lang/spirv/ast_writer/function.cc",
"lang/spirv/ast_writer/function.h",
"lang/spirv/ast_writer/generator.cc",
"lang/spirv/ast_writer/generator.h",
"lang/spirv/ast_writer/generator_impl.cc",
"lang/spirv/ast_writer/generator_impl.h",
"lang/spirv/ast_writer/instruction.cc",
"lang/spirv/ast_writer/instruction.h",
"lang/spirv/ast_writer/module.cc",
"lang/spirv/ast_writer/module.h",
"lang/spirv/ast_writer/operand.cc",
"lang/spirv/ast_writer/operand.h",
"lang/spirv/ast_writer/scalar_constant.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_transform_manager_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
if (tint_build_ir) {
sources += [
"lang/spirv/writer/writer.cc",
"lang/spirv/writer/writer.h",
]
deps += [
":libtint_ir_builder_src",
":libtint_ir_src",
":libtint_ir_transform_src",
]
}
}
libtint_source_set("libtint_wgsl_reader_src") {
sources = [
"lang/wgsl/reader/classify_template_args.cc",
"lang/wgsl/reader/classify_template_args.h",
"lang/wgsl/reader/lexer.cc",
"lang/wgsl/reader/lexer.h",
"lang/wgsl/reader/parser.cc",
"lang/wgsl/reader/parser.h",
"lang/wgsl/reader/parser_impl.cc",
"lang/wgsl/reader/parser_impl.h",
"lang/wgsl/reader/parser_impl_detail.h",
"lang/wgsl/reader/token.cc",
"lang/wgsl/reader/token.h",
]
deps = [
":libtint_ast_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_reader_src",
":libtint_symbols_src",
":libtint_type_src",
":libtint_utils_src",
]
}
libtint_source_set("libtint_wgsl_writer_src") {
sources = [
"lang/wgsl/ast_writer/generator.cc",
"lang/wgsl/ast_writer/generator.h",
"lang/wgsl/ast_writer/generator_impl.cc",
"lang/wgsl/ast_writer/generator_impl.h",
]
deps = [
":libtint_ast_src",
":libtint_builtins_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
}
libtint_source_set("libtint_msl_writer_src") {
sources = [
"lang/msl/ast_writer/generator.cc",
"lang/msl/ast_writer/generator.h",
"lang/msl/ast_writer/generator_impl.cc",
"lang/msl/ast_writer/generator_impl.h",
"lang/msl/ast_writer/generator_support.cc",
"lang/msl/ast_writer/generator_support.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_transform_manager_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
if (tint_build_ir) {
sources += [
"lang/msl/writer/generator_impl_ir.cc",
"lang/msl/writer/generator_impl_ir.h",
]
deps += [
":libtint_ir_builder_src",
":libtint_ir_src",
":libtint_ir_transform_src",
]
}
}
libtint_source_set("libtint_hlsl_writer_src") {
sources = [
"lang/hlsl/ast_writer/generator.cc",
"lang/hlsl/ast_writer/generator.h",
"lang/hlsl/ast_writer/generator_impl.cc",
"lang/hlsl/ast_writer/generator_impl.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_transform_manager_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
}
libtint_source_set("libtint_glsl_writer_src") {
sources = [
"lang/glsl/ast_writer/generator.cc",
"lang/glsl/ast_writer/generator.h",
"lang/glsl/ast_writer/generator_impl.cc",
"lang/glsl/ast_writer/generator_impl.h",
]
deps = [
":libtint_ast_src",
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_constant_src",
":libtint_program_src",
":libtint_sem_src",
":libtint_symbols_src",
":libtint_transform_manager_src",
":libtint_type_src",
":libtint_utils_src",
":libtint_writer_src",
]
}
libtint_source_set("libtint_syntax_tree_writer_src") {
sources = [
"lang/wgsl/syntax_tree_writer/generator.cc",
"lang/wgsl/syntax_tree_writer/generator.h",
"lang/wgsl/syntax_tree_writer/generator_impl.cc",
"lang/wgsl/syntax_tree_writer/generator_impl.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_builder_src") {
sources = [
"lang/core/ir/from_program.cc",
"lang/core/ir/from_program.h",
"lang/core/ir/to_program.cc",
"lang/core/ir/to_program.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_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/binding_point.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/transform/transform.cc",
"lang/core/ir/transform/transform.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_transform_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_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_builder_src",
":libtint_ir_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_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/test_helper.h",
"lang/wgsl/ast/test_helper_test.cc",
]
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/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_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/builtin/access_test.cc",
"lang/core/builtin/address_space_test.cc",
"lang/core/builtin/attribute_test.cc",
"lang/core/builtin/builtin_test.cc",
"lang/core/builtin/builtin_value_test.cc",
"lang/core/builtin/diagnostic_rule_test.cc",
"lang/core/builtin/diagnostic_severity_test.cc",
"lang/core/builtin/extension_test.cc",
"lang/core/builtin/interpolation_sampling_test.cc",
"lang/core/builtin/interpolation_type_test.cc",
"lang/core/builtin/number_test.cc",
"lang/core/builtin/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_test.cc",
"lang/wgsl/inspector/test_inspector_builder.cc",
"lang/wgsl/inspector/test_inspector_builder.h",
"lang/wgsl/inspector/test_inspector_runner.cc",
"lang/wgsl/inspector/test_inspector_runner.h",
]
deps = [ ":libtint_inspector_src" ]
}
tint_unittests_source_set("tint_unittests_resolver_src") {
sources = [
"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/const_eval_binary_op_test.cc",
"lang/wgsl/resolver/const_eval_bitcast_test.cc",
"lang/wgsl/resolver/const_eval_builtin_test.cc",
"lang/wgsl/resolver/const_eval_construction_test.cc",
"lang/wgsl/resolver/const_eval_conversion_test.cc",
"lang/wgsl/resolver/const_eval_indexing_test.cc",
"lang/wgsl/resolver/const_eval_member_access_test.cc",
"lang/wgsl/resolver/const_eval_runtime_semantics_test.cc",
"lang/wgsl/resolver/const_eval_test.h",
"lang/wgsl/resolver/const_eval_unary_op_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/intrinsic_table_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_test.cc",
"lang/wgsl/resolver/resolver_test_helper.cc",
"lang/wgsl/resolver/resolver_test_helper.h",
"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/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_ast_transform_src",
":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/localize_struct_array_assignment_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/test_helper.h",
"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/utils/get_insertion_point_test.cc",
"lang/wgsl/ast/transform/utils/hoist_to_decl_before_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_transform_manager_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/block_decorated_structs_test.cc",
"lang/core/ir/transform/demote_to_helper_test.cc",
"lang/core/ir/transform/test_helper.h",
]
deps = [
":libtint_ir_src",
":libtint_ir_transform_src",
":libtint_transform_manager_src",
]
if (tint_build_spv_writer) {
sources += [
"lang/core/ir/transform/builtin_polyfill_spirv_test.cc",
"lang/core/ir/transform/expand_implicit_splats_test.cc",
"lang/core/ir/transform/handle_matrix_arithmetic_test.cc",
"lang/core/ir/transform/merge_return_test.cc",
"lang/core/ir/transform/shader_io_spirv_test.cc",
"lang/core/ir/transform/var_for_dynamic_index_test.cc",
]
}
if (tint_build_wgsl_writer) {
sources += [ "lang/core/ir/transform/rename_conflicts_test.cc" ]
}
}
}
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/debug/debug_test.cc",
"utils/diagnostic/source_test.cc",
"utils/file/tmpfile_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/text/float_to_string_test.cc",
"writer/ast_text_generator_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/generate_external_texture_bindings.cc",
"cmd/generate_external_texture_bindings.h",
"cmd/generate_external_texture_bindings_test.cc",
]
}
tint_unittests_source_set("tint_unittests_spv_reader_src") {
sources = [
"lang/spirv/reader/enum_converter_test.cc",
"lang/spirv/reader/fail_stream_test.cc",
"lang/spirv/reader/function_arithmetic_test.cc",
"lang/spirv/reader/function_bit_test.cc",
"lang/spirv/reader/function_call_test.cc",
"lang/spirv/reader/function_cfg_test.cc",
"lang/spirv/reader/function_composite_test.cc",
"lang/spirv/reader/function_conversion_test.cc",
"lang/spirv/reader/function_decl_test.cc",
"lang/spirv/reader/function_glsl_std_450_test.cc",
"lang/spirv/reader/function_logical_test.cc",
"lang/spirv/reader/function_memory_test.cc",
"lang/spirv/reader/function_misc_test.cc",
"lang/spirv/reader/function_var_test.cc",
"lang/spirv/reader/namer_test.cc",
"lang/spirv/reader/parser_impl_barrier_test.cc",
"lang/spirv/reader/parser_impl_constant_test.cc",
"lang/spirv/reader/parser_impl_convert_member_decoration_test.cc",
"lang/spirv/reader/parser_impl_convert_type_test.cc",
"lang/spirv/reader/parser_impl_function_decl_test.cc",
"lang/spirv/reader/parser_impl_get_decorations_test.cc",
"lang/spirv/reader/parser_impl_handle_test.cc",
"lang/spirv/reader/parser_impl_import_test.cc",
"lang/spirv/reader/parser_impl_module_var_test.cc",
"lang/spirv/reader/parser_impl_named_types_test.cc",
"lang/spirv/reader/parser_impl_test.cc",
"lang/spirv/reader/parser_impl_test_helper.cc",
"lang/spirv/reader/parser_impl_test_helper.h",
"lang/spirv/reader/parser_impl_user_name_test.cc",
"lang/spirv/reader/parser_test.cc",
"lang/spirv/reader/parser_type_test.cc",
"lang/spirv/reader/spirv_tools_helpers_test.cc",
"lang/spirv/reader/spirv_tools_helpers_test.h",
"lang/spirv/reader/usage_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/ast_writer/binary_writer_test.cc",
"lang/spirv/ast_writer/builder_accessor_expression_test.cc",
"lang/spirv/ast_writer/builder_assign_test.cc",
"lang/spirv/ast_writer/builder_binary_expression_test.cc",
"lang/spirv/ast_writer/builder_bitcast_expression_test.cc",
"lang/spirv/ast_writer/builder_block_test.cc",
"lang/spirv/ast_writer/builder_builtin_test.cc",
"lang/spirv/ast_writer/builder_builtin_texture_test.cc",
"lang/spirv/ast_writer/builder_call_test.cc",
"lang/spirv/ast_writer/builder_const_assert_test.cc",
"lang/spirv/ast_writer/builder_constructor_expression_test.cc",
"lang/spirv/ast_writer/builder_discard_test.cc",
"lang/spirv/ast_writer/builder_entry_point_test.cc",
"lang/spirv/ast_writer/builder_format_conversion_test.cc",
"lang/spirv/ast_writer/builder_function_attribute_test.cc",
"lang/spirv/ast_writer/builder_function_test.cc",
"lang/spirv/ast_writer/builder_function_variable_test.cc",
"lang/spirv/ast_writer/builder_global_variable_test.cc",
"lang/spirv/ast_writer/builder_ident_expression_test.cc",
"lang/spirv/ast_writer/builder_if_test.cc",
"lang/spirv/ast_writer/builder_literal_test.cc",
"lang/spirv/ast_writer/builder_loop_test.cc",
"lang/spirv/ast_writer/builder_return_test.cc",
"lang/spirv/ast_writer/builder_switch_test.cc",
"lang/spirv/ast_writer/builder_test.cc",
"lang/spirv/ast_writer/builder_type_test.cc",
"lang/spirv/ast_writer/builder_unary_op_expression_test.cc",
"lang/spirv/ast_writer/instruction_test.cc",
"lang/spirv/ast_writer/module_test.cc",
"lang/spirv/ast_writer/operand_test.cc",
"lang/spirv/ast_writer/scalar_constant_test.cc",
"lang/spirv/ast_writer/spv_dump.cc",
"lang/spirv/ast_writer/spv_dump.h",
"lang/spirv/ast_writer/test_helper.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/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/switch_test.cc",
"lang/spirv/writer/swizzle_test.cc",
"lang/spirv/writer/test_helper.h",
"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_source_set("tint_unittests_wgsl_reader_src") {
sources = [
"lang/wgsl/reader/classify_template_args_test.cc",
"lang/wgsl/reader/lexer_test.cc",
"lang/wgsl/reader/parser_impl_additive_expression_test.cc",
"lang/wgsl/reader/parser_impl_argument_expression_list_test.cc",
"lang/wgsl/reader/parser_impl_assignment_stmt_test.cc",
"lang/wgsl/reader/parser_impl_bitwise_expression_test.cc",
"lang/wgsl/reader/parser_impl_break_stmt_test.cc",
"lang/wgsl/reader/parser_impl_bug_cases_test.cc",
"lang/wgsl/reader/parser_impl_call_stmt_test.cc",
"lang/wgsl/reader/parser_impl_compound_stmt_test.cc",
"lang/wgsl/reader/parser_impl_const_literal_test.cc",
"lang/wgsl/reader/parser_impl_continue_stmt_test.cc",
"lang/wgsl/reader/parser_impl_continuing_stmt_test.cc",
"lang/wgsl/reader/parser_impl_core_lhs_expression_test.cc",
"lang/wgsl/reader/parser_impl_diagnostic_attribute_test.cc",
"lang/wgsl/reader/parser_impl_diagnostic_control_test.cc",
"lang/wgsl/reader/parser_impl_diagnostic_directive_test.cc",
"lang/wgsl/reader/parser_impl_enable_directive_test.cc",
"lang/wgsl/reader/parser_impl_error_msg_test.cc",
"lang/wgsl/reader/parser_impl_error_resync_test.cc",
"lang/wgsl/reader/parser_impl_expression_test.cc",
"lang/wgsl/reader/parser_impl_for_stmt_test.cc",
"lang/wgsl/reader/parser_impl_function_attribute_list_test.cc",
"lang/wgsl/reader/parser_impl_function_attribute_test.cc",
"lang/wgsl/reader/parser_impl_function_decl_test.cc",
"lang/wgsl/reader/parser_impl_function_header_test.cc",
"lang/wgsl/reader/parser_impl_global_constant_decl_test.cc",
"lang/wgsl/reader/parser_impl_global_decl_test.cc",
"lang/wgsl/reader/parser_impl_global_variable_decl_test.cc",
"lang/wgsl/reader/parser_impl_if_stmt_test.cc",
"lang/wgsl/reader/parser_impl_increment_decrement_stmt_test.cc",
"lang/wgsl/reader/parser_impl_lhs_expression_test.cc",
"lang/wgsl/reader/parser_impl_loop_stmt_test.cc",
"lang/wgsl/reader/parser_impl_math_expression_test.cc",
"lang/wgsl/reader/parser_impl_multiplicative_expression_test.cc",
"lang/wgsl/reader/parser_impl_param_list_test.cc",
"lang/wgsl/reader/parser_impl_paren_expression_test.cc",
"lang/wgsl/reader/parser_impl_primary_expression_test.cc",
"lang/wgsl/reader/parser_impl_relational_expression_test.cc",
"lang/wgsl/reader/parser_impl_require_directive_test.cc",
"lang/wgsl/reader/parser_impl_reserved_keyword_test.cc",
"lang/wgsl/reader/parser_impl_shift_expression_test.cc",
"lang/wgsl/reader/parser_impl_singular_expression_test.cc",
"lang/wgsl/reader/parser_impl_statement_test.cc",
"lang/wgsl/reader/parser_impl_statements_test.cc",
"lang/wgsl/reader/parser_impl_struct_attribute_decl_test.cc",
"lang/wgsl/reader/parser_impl_struct_body_decl_test.cc",
"lang/wgsl/reader/parser_impl_struct_decl_test.cc",
"lang/wgsl/reader/parser_impl_struct_member_attribute_decl_test.cc",
"lang/wgsl/reader/parser_impl_struct_member_attribute_test.cc",
"lang/wgsl/reader/parser_impl_struct_member_test.cc",
"lang/wgsl/reader/parser_impl_switch_body_test.cc",
"lang/wgsl/reader/parser_impl_switch_stmt_test.cc",
"lang/wgsl/reader/parser_impl_test.cc",
"lang/wgsl/reader/parser_impl_test_helper.cc",
"lang/wgsl/reader/parser_impl_test_helper.h",
"lang/wgsl/reader/parser_impl_type_alias_test.cc",
"lang/wgsl/reader/parser_impl_type_decl_test.cc",
"lang/wgsl/reader/parser_impl_unary_expression_test.cc",
"lang/wgsl/reader/parser_impl_variable_attribute_list_test.cc",
"lang/wgsl/reader/parser_impl_variable_attribute_test.cc",
"lang/wgsl/reader/parser_impl_variable_decl_test.cc",
"lang/wgsl/reader/parser_impl_variable_ident_decl_test.cc",
"lang/wgsl/reader/parser_impl_variable_qualifier_test.cc",
"lang/wgsl/reader/parser_impl_variable_stmt_test.cc",
"lang/wgsl/reader/parser_impl_while_stmt_test.cc",
"lang/wgsl/reader/parser_test.cc",
"lang/wgsl/reader/token_test.cc",
]
deps = [
":libtint_builtins_src",
":libtint_unittests_ast_helper",
":libtint_wgsl_reader_src",
]
}
tint_unittests_source_set("tint_unittests_wgsl_writer_src") {
sources = [
"lang/wgsl/ast_writer/generator_impl_alias_type_test.cc",
"lang/wgsl/ast_writer/generator_impl_array_accessor_test.cc",
"lang/wgsl/ast_writer/generator_impl_assign_test.cc",
"lang/wgsl/ast_writer/generator_impl_binary_test.cc",
"lang/wgsl/ast_writer/generator_impl_bitcast_test.cc",
"lang/wgsl/ast_writer/generator_impl_block_test.cc",
"lang/wgsl/ast_writer/generator_impl_break_test.cc",
"lang/wgsl/ast_writer/generator_impl_call_test.cc",
"lang/wgsl/ast_writer/generator_impl_case_test.cc",
"lang/wgsl/ast_writer/generator_impl_cast_test.cc",
"lang/wgsl/ast_writer/generator_impl_const_assert_test.cc",
"lang/wgsl/ast_writer/generator_impl_constructor_test.cc",
"lang/wgsl/ast_writer/generator_impl_continue_test.cc",
"lang/wgsl/ast_writer/generator_impl_diagnostic_test.cc",
"lang/wgsl/ast_writer/generator_impl_discard_test.cc",
"lang/wgsl/ast_writer/generator_impl_enable_test.cc",
"lang/wgsl/ast_writer/generator_impl_function_test.cc",
"lang/wgsl/ast_writer/generator_impl_global_decl_test.cc",
"lang/wgsl/ast_writer/generator_impl_identifier_test.cc",
"lang/wgsl/ast_writer/generator_impl_if_test.cc",
"lang/wgsl/ast_writer/generator_impl_literal_test.cc",
"lang/wgsl/ast_writer/generator_impl_loop_test.cc",
"lang/wgsl/ast_writer/generator_impl_member_accessor_test.cc",
"lang/wgsl/ast_writer/generator_impl_return_test.cc",
"lang/wgsl/ast_writer/generator_impl_switch_test.cc",
"lang/wgsl/ast_writer/generator_impl_test.cc",
"lang/wgsl/ast_writer/generator_impl_type_test.cc",
"lang/wgsl/ast_writer/generator_impl_unary_op_test.cc",
"lang/wgsl/ast_writer/generator_impl_variable_decl_statement_test.cc",
"lang/wgsl/ast_writer/generator_impl_variable_test.cc",
"lang/wgsl/ast_writer/test_helper.h",
]
deps = [
":libtint_builtins_src",
":libtint_utils_src",
":libtint_wgsl_writer_src",
":tint_unittests_ast_src",
]
}
tint_unittests_source_set("tint_unittests_msl_writer_src") {
sources = [
"lang/msl/ast_writer/generator_impl_array_accessor_test.cc",
"lang/msl/ast_writer/generator_impl_assign_test.cc",
"lang/msl/ast_writer/generator_impl_binary_test.cc",
"lang/msl/ast_writer/generator_impl_bitcast_test.cc",
"lang/msl/ast_writer/generator_impl_block_test.cc",
"lang/msl/ast_writer/generator_impl_break_test.cc",
"lang/msl/ast_writer/generator_impl_builtin_test.cc",
"lang/msl/ast_writer/generator_impl_builtin_texture_test.cc",
"lang/msl/ast_writer/generator_impl_call_test.cc",
"lang/msl/ast_writer/generator_impl_case_test.cc",
"lang/msl/ast_writer/generator_impl_cast_test.cc",
"lang/msl/ast_writer/generator_impl_const_assert_test.cc",
"lang/msl/ast_writer/generator_impl_constructor_test.cc",
"lang/msl/ast_writer/generator_impl_continue_test.cc",
"lang/msl/ast_writer/generator_impl_discard_test.cc",
"lang/msl/ast_writer/generator_impl_function_test.cc",
"lang/msl/ast_writer/generator_impl_identifier_test.cc",
"lang/msl/ast_writer/generator_impl_if_test.cc",
"lang/msl/ast_writer/generator_impl_import_test.cc",
"lang/msl/ast_writer/generator_impl_loop_test.cc",
"lang/msl/ast_writer/generator_impl_member_accessor_test.cc",
"lang/msl/ast_writer/generator_impl_module_constant_test.cc",
"lang/msl/ast_writer/generator_impl_return_test.cc",
"lang/msl/ast_writer/generator_impl_sanitizer_test.cc",
"lang/msl/ast_writer/generator_impl_switch_test.cc",
"lang/msl/ast_writer/generator_impl_test.cc",
"lang/msl/ast_writer/generator_impl_type_test.cc",
"lang/msl/ast_writer/generator_impl_unary_op_test.cc",
"lang/msl/ast_writer/generator_impl_variable_decl_statement_test.cc",
"lang/msl/ast_writer/generator_support_test.cc",
"lang/msl/ast_writer/test_helper.h",
]
deps = [
":libtint_msl_writer_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
if (tint_build_ir) {
sources += [
"lang/msl/writer/generator_impl_ir_constant_test.cc",
"lang/msl/writer/generator_impl_ir_function_test.cc",
"lang/msl/writer/generator_impl_ir_type_test.cc",
"lang/msl/writer/test_helper_ir.h",
]
deps += [ ":libtint_ir_src" ]
}
}
tint_unittests_source_set("tint_unittests_hlsl_writer_src") {
sources = [
"lang/hlsl/ast_writer/generator_impl_array_accessor_test.cc",
"lang/hlsl/ast_writer/generator_impl_assign_test.cc",
"lang/hlsl/ast_writer/generator_impl_binary_test.cc",
"lang/hlsl/ast_writer/generator_impl_bitcast_test.cc",
"lang/hlsl/ast_writer/generator_impl_block_test.cc",
"lang/hlsl/ast_writer/generator_impl_break_test.cc",
"lang/hlsl/ast_writer/generator_impl_builtin_test.cc",
"lang/hlsl/ast_writer/generator_impl_builtin_texture_test.cc",
"lang/hlsl/ast_writer/generator_impl_call_test.cc",
"lang/hlsl/ast_writer/generator_impl_case_test.cc",
"lang/hlsl/ast_writer/generator_impl_cast_test.cc",
"lang/hlsl/ast_writer/generator_impl_const_assert_test.cc",
"lang/hlsl/ast_writer/generator_impl_constructor_test.cc",
"lang/hlsl/ast_writer/generator_impl_continue_test.cc",
"lang/hlsl/ast_writer/generator_impl_discard_test.cc",
"lang/hlsl/ast_writer/generator_impl_function_test.cc",
"lang/hlsl/ast_writer/generator_impl_identifier_test.cc",
"lang/hlsl/ast_writer/generator_impl_if_test.cc",
"lang/hlsl/ast_writer/generator_impl_import_test.cc",
"lang/hlsl/ast_writer/generator_impl_loop_test.cc",
"lang/hlsl/ast_writer/generator_impl_member_accessor_test.cc",
"lang/hlsl/ast_writer/generator_impl_module_constant_test.cc",
"lang/hlsl/ast_writer/generator_impl_return_test.cc",
"lang/hlsl/ast_writer/generator_impl_sanitizer_test.cc",
"lang/hlsl/ast_writer/generator_impl_switch_test.cc",
"lang/hlsl/ast_writer/generator_impl_test.cc",
"lang/hlsl/ast_writer/generator_impl_type_test.cc",
"lang/hlsl/ast_writer/generator_impl_unary_op_test.cc",
"lang/hlsl/ast_writer/generator_impl_variable_decl_statement_test.cc",
"lang/hlsl/ast_writer/generator_impl_workgroup_var_test.cc",
"lang/hlsl/ast_writer/test_helper.h",
]
deps = [
":libtint_ast_transform_src",
":libtint_hlsl_writer_src",
":libtint_transform_manager_src",
":libtint_utils_src",
":tint_unittests_ast_src",
]
}
tint_unittests_source_set("tint_unittests_glsl_writer_src") {
sources = [
"lang/glsl/ast_writer/generator_impl_array_accessor_test.cc",
"lang/glsl/ast_writer/generator_impl_assign_test.cc",
"lang/glsl/ast_writer/generator_impl_binary_test.cc",
"lang/glsl/ast_writer/generator_impl_bitcast_test.cc",
"lang/glsl/ast_writer/generator_impl_block_test.cc",
"lang/glsl/ast_writer/generator_impl_break_test.cc",
"lang/glsl/ast_writer/generator_impl_builtin_test.cc",
"lang/glsl/ast_writer/generator_impl_builtin_texture_test.cc",
"lang/glsl/ast_writer/generator_impl_call_test.cc",
"lang/glsl/ast_writer/generator_impl_case_test.cc",
"lang/glsl/ast_writer/generator_impl_cast_test.cc",
"lang/glsl/ast_writer/generator_impl_constructor_test.cc",
"lang/glsl/ast_writer/generator_impl_continue_test.cc",
"lang/glsl/ast_writer/generator_impl_discard_test.cc",
"lang/glsl/ast_writer/generator_impl_function_test.cc",
"lang/glsl/ast_writer/generator_impl_identifier_test.cc",
"lang/glsl/ast_writer/generator_impl_if_test.cc",
"lang/glsl/ast_writer/generator_impl_import_test.cc",
"lang/glsl/ast_writer/generator_impl_loop_test.cc",
"lang/glsl/ast_writer/generator_impl_member_accessor_test.cc",
"lang/glsl/ast_writer/generator_impl_module_constant_test.cc",
"lang/glsl/ast_writer/generator_impl_return_test.cc",
"lang/glsl/ast_writer/generator_impl_sanitizer_test.cc",
"lang/glsl/ast_writer/generator_impl_storage_buffer_test.cc",
"lang/glsl/ast_writer/generator_impl_switch_test.cc",
"lang/glsl/ast_writer/generator_impl_test.cc",
"lang/glsl/ast_writer/generator_impl_type_test.cc",
"lang/glsl/ast_writer/generator_impl_unary_op_test.cc",
"lang/glsl/ast_writer/generator_impl_uniform_buffer_test.cc",
"lang/glsl/ast_writer/generator_impl_variable_decl_statement_test.cc",
"lang/glsl/ast_writer/generator_impl_workgroup_var_test.cc",
"lang/glsl/ast_writer/test_helper.h",
]
deps = [
":libtint_ast_transform_src",
":libtint_builtins_src",
":libtint_glsl_writer_src",
":libtint_symbols_src",
":libtint_transform_manager_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/text/symbol_table_test.cc",
"utils/text/symbol_test.cc",
]
deps = [ ":libtint_symbols_src" ]
}
tint_unittests_source_set("tint_unittests_core_src") {
sources = [
"clone_context_test.cc",
"lang/wgsl/program/program_builder_test.cc",
"lang/wgsl/program/program_test.cc",
"transform/manager_test.cc",
]
deps = [
":libtint_ast_transform_base_src",
":libtint_program_src",
":libtint_transform_manager_src",
":libtint_unittests_ast_helper",
":tint_unittests_ast_src",
]
if (tint_build_ir) {
deps += [
":libtint_ir_builder_src",
":libtint_ir_src",
]
}
}
if (tint_build_ir) {
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/from_program_accessor_test.cc",
"lang/core/ir/from_program_binary_test.cc",
"lang/core/ir/from_program_builtin_test.cc",
"lang/core/ir/from_program_call_test.cc",
"lang/core/ir/from_program_function_test.cc",
"lang/core/ir/from_program_let_test.cc",
"lang/core/ir/from_program_literal_test.cc",
"lang/core/ir/from_program_materialize_test.cc",
"lang/core/ir/from_program_shadowing_test.cc",
"lang/core/ir/from_program_store_test.cc",
"lang/core/ir/from_program_test.cc",
"lang/core/ir/from_program_unary_test.cc",
"lang/core/ir/from_program_var_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/ir_test_helper.h",
"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/program_test_helper.h",
"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/to_program_inlining_test.cc",
"lang/core/ir/to_program_roundtrip_test.cc",
"lang/core/ir/to_program_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_builder_src",
":libtint_ir_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_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 (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
}
}