2020-04-08 20:40:25 +00:00
|
|
|
# Copyright 2020 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")
|
2020-04-17 13:18:20 +00:00
|
|
|
import("//testing/test.gni")
|
2020-04-15 20:35:38 +00:00
|
|
|
import("tint_overrides_with_defaults.gni")
|
2020-04-08 20:40:25 +00:00
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
###############################################################################
|
|
|
|
# Common - Configs, etc. shared across targets
|
|
|
|
###############################################################################
|
|
|
|
|
2020-04-08 20:40:25 +00:00
|
|
|
config("tint_common_config") {
|
2020-06-16 17:26:59 +00:00
|
|
|
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") {
|
2020-04-08 20:40:25 +00:00
|
|
|
defines = []
|
2020-04-15 20:35:38 +00:00
|
|
|
if (tint_build_spv_reader) {
|
|
|
|
defines += [ "TINT_BUILD_SPV_READER=1" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "TINT_BUILD_SPV_READER=0" ]
|
|
|
|
}
|
2020-04-15 20:37:02 +00:00
|
|
|
|
|
|
|
if (tint_build_spv_writer) {
|
|
|
|
defines += [ "TINT_BUILD_SPV_WRITER=1" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "TINT_BUILD_SPV_WRITER=0" ]
|
|
|
|
}
|
2020-04-15 20:47:55 +00:00
|
|
|
|
|
|
|
if (tint_build_wgsl_reader) {
|
|
|
|
defines += [ "TINT_BUILD_WGSL_READER=1" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "TINT_BUILD_WGSL_READER=0" ]
|
|
|
|
}
|
2020-04-15 20:54:10 +00:00
|
|
|
|
|
|
|
if (tint_build_wgsl_writer) {
|
|
|
|
defines += [ "TINT_BUILD_WGSL_WRITER=1" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "TINT_BUILD_WGSL_WRITER=0" ]
|
|
|
|
}
|
2020-04-27 15:31:27 +00:00
|
|
|
|
2020-06-23 17:48:40 +00:00
|
|
|
if (tint_build_msl_writer) {
|
|
|
|
defines += [ "TINT_BUILD_MSL_WRITER=1" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "TINT_BUILD_MSL_WRITER=0" ]
|
|
|
|
}
|
|
|
|
|
2020-07-20 22:13:37 +00:00
|
|
|
if (tint_build_hlsl_writer) {
|
|
|
|
defines += [ "TINT_BUILD_HLSL_WRITER=1" ]
|
|
|
|
} else {
|
|
|
|
defines += [ "TINT_BUILD_HLSL_WRITER=0" ]
|
|
|
|
}
|
|
|
|
|
2020-04-27 15:31:27 +00:00
|
|
|
include_dirs = [
|
|
|
|
"${tint_root_dir}/",
|
2020-06-16 17:26:59 +00:00
|
|
|
"${tint_root_dir}/include/",
|
2020-09-01 21:29:06 +00:00
|
|
|
"${tint_spirv_headers_dir}/include",
|
2020-04-27 15:31:27 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Generated - Generated source files
|
|
|
|
###############################################################################
|
|
|
|
# These are copies of rules from SPIRV-Tools with the names tweaked to be Tint
|
|
|
|
# specific. They are needed here because referencing generated files in sibling
|
|
|
|
# packages is difficult/impossible in Chromium. Parts of Tint's SPIRV handling
|
|
|
|
# code depend on internal parts of SPIRV-Tools. This causes issues because when
|
|
|
|
# Tint references the internal headers, since it causes a dependency on these
|
|
|
|
# generated files, but they are not visible in the context building Tint. Thus
|
|
|
|
# Tint generates its own copy of the generated files. Since they come from the
|
|
|
|
# same source of truth, they should not vary.
|
|
|
|
|
|
|
|
template("tint_core_tables") {
|
|
|
|
assert(defined(invoker.version), "Need version in $target_name generation.")
|
|
|
|
|
|
|
|
action("tint_core_tables_" + target_name) {
|
|
|
|
script = "${tint_spirv_tools_dir}/utils/generate_grammar_tables.py"
|
|
|
|
|
|
|
|
version = invoker.version
|
|
|
|
|
|
|
|
core_json_file = "${tint_spirv_headers_dir}/include/spirv/$version/spirv.core.grammar.json"
|
|
|
|
core_insts_file = "${target_gen_dir}/core.insts-$version.inc"
|
|
|
|
operand_kinds_file = "${target_gen_dir}/operand.kinds-$version.inc"
|
2020-08-04 17:56:27 +00:00
|
|
|
debuginfo_insts_file = "${tint_spirv_headers_dir}/include/spirv/unified1/extinst.debuginfo.grammar.json"
|
|
|
|
cldebuginfo100_insts_file = "${tint_spirv_headers_dir}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
|
2020-04-27 15:31:27 +00:00
|
|
|
|
|
|
|
sources = [
|
|
|
|
cldebuginfo100_insts_file,
|
|
|
|
core_json_file,
|
|
|
|
debuginfo_insts_file,
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
core_insts_file,
|
|
|
|
operand_kinds_file,
|
|
|
|
]
|
|
|
|
args = [
|
|
|
|
"--spirv-core-grammar",
|
|
|
|
rebase_path(core_json_file, root_build_dir),
|
|
|
|
"--core-insts-output",
|
|
|
|
rebase_path(core_insts_file, root_build_dir),
|
|
|
|
"--extinst-debuginfo-grammar",
|
|
|
|
rebase_path(debuginfo_insts_file, root_build_dir),
|
|
|
|
"--extinst-cldebuginfo100-grammar",
|
|
|
|
rebase_path(cldebuginfo100_insts_file, root_build_dir),
|
|
|
|
"--operand-kinds-output",
|
|
|
|
rebase_path(operand_kinds_file, root_build_dir),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template("tint_core_enums") {
|
|
|
|
assert(defined(invoker.version), "Need version in $target_name generation.")
|
|
|
|
|
|
|
|
action("tint_core_enums_" + target_name) {
|
|
|
|
script = "${tint_spirv_tools_dir}/utils/generate_grammar_tables.py"
|
|
|
|
|
|
|
|
version = invoker.version
|
|
|
|
|
|
|
|
core_json_file = "${tint_spirv_headers_dir}/include/spirv/$version/spirv.core.grammar.json"
|
2020-08-04 17:56:27 +00:00
|
|
|
debuginfo_insts_file = "${tint_spirv_headers_dir}/include/spirv/unified1/extinst.debuginfo.grammar.json"
|
|
|
|
cldebuginfo100_insts_file = "${tint_spirv_headers_dir}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
|
2020-04-27 15:31:27 +00:00
|
|
|
|
|
|
|
extension_enum_file = "${target_gen_dir}/extension_enum.inc"
|
|
|
|
extension_map_file = "${target_gen_dir}/enum_string_mapping.inc"
|
|
|
|
|
|
|
|
args = [
|
|
|
|
"--spirv-core-grammar",
|
|
|
|
rebase_path(core_json_file, root_build_dir),
|
|
|
|
"--extinst-debuginfo-grammar",
|
|
|
|
rebase_path(debuginfo_insts_file, root_build_dir),
|
|
|
|
"--extinst-cldebuginfo100-grammar",
|
|
|
|
rebase_path(cldebuginfo100_insts_file, root_build_dir),
|
|
|
|
"--extension-enum-output",
|
|
|
|
rebase_path(extension_enum_file, root_build_dir),
|
|
|
|
"--enum-string-mapping-output",
|
|
|
|
rebase_path(extension_map_file, root_build_dir),
|
|
|
|
]
|
|
|
|
inputs = [
|
|
|
|
core_json_file,
|
|
|
|
debuginfo_insts_file,
|
|
|
|
cldebuginfo100_insts_file,
|
|
|
|
]
|
|
|
|
outputs = [
|
|
|
|
extension_enum_file,
|
|
|
|
extension_map_file,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template("tint_language_header") {
|
|
|
|
assert(defined(invoker.name), "Need name in $target_name generation.")
|
|
|
|
|
|
|
|
action("tint_language_header_" + target_name) {
|
|
|
|
script = "${tint_spirv_tools_dir}/utils/generate_language_headers.py"
|
|
|
|
|
|
|
|
name = invoker.name
|
|
|
|
extinst_output_path = "${target_gen_dir}/${name}.h"
|
|
|
|
|
|
|
|
args = [
|
|
|
|
"--extinst-grammar",
|
|
|
|
rebase_path(invoker.grammar_file, root_build_dir),
|
|
|
|
"--extinst-output-path",
|
|
|
|
rebase_path(extinst_output_path, root_build_dir),
|
|
|
|
]
|
|
|
|
inputs = [ invoker.grammar_file ]
|
|
|
|
outputs = [ "${extinst_output_path}" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tint_core_tables("unified1") {
|
|
|
|
version = "unified1"
|
|
|
|
}
|
|
|
|
|
|
|
|
tint_core_enums("unified1") {
|
|
|
|
version = "unified1"
|
|
|
|
}
|
|
|
|
|
|
|
|
tint_language_header("debuginfo") {
|
|
|
|
name = "DebugInfo"
|
2020-08-04 17:56:27 +00:00
|
|
|
grammar_file = "${tint_spirv_headers_dir}/include/spirv/unified1/extinst.debuginfo.grammar.json"
|
2020-04-27 15:31:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tint_language_header("cldebuginfo100") {
|
|
|
|
name = "OpenCLDebugInfo100"
|
2020-08-04 17:56:27 +00:00
|
|
|
grammar_file = "${tint_spirv_headers_dir}/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"
|
2020-04-08 20:40:25 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
###############################################################################
|
|
|
|
# Library - Tint core and optional modules of libtint
|
|
|
|
###############################################################################
|
|
|
|
# libtint source sets are divided into a non-optional core in :libtint_core_src
|
|
|
|
# and optional :libtint_*_src subsets, because ninja does not like having
|
|
|
|
# multiple source files with the same name, like function.cc, in the same
|
|
|
|
# source set
|
|
|
|
# target.
|
2020-04-15 20:35:38 +00:00
|
|
|
#
|
2020-04-17 13:18:20 +00:00
|
|
|
# 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.
|
2020-04-15 20:35:38 +00:00
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
source_set("libtint_core_src") {
|
2020-04-08 20:40:25 +00:00
|
|
|
sources = [
|
|
|
|
"src/ast/array_accessor_expression.cc",
|
|
|
|
"src/ast/array_accessor_expression.h",
|
|
|
|
"src/ast/assignment_statement.cc",
|
|
|
|
"src/ast/assignment_statement.h",
|
|
|
|
"src/ast/binary_expression.cc",
|
|
|
|
"src/ast/binary_expression.h",
|
|
|
|
"src/ast/binding_decoration.cc",
|
|
|
|
"src/ast/binding_decoration.h",
|
2020-09-22 22:07:13 +00:00
|
|
|
"src/ast/bitcast_expression.cc",
|
|
|
|
"src/ast/bitcast_expression.h",
|
2020-07-27 15:25:00 +00:00
|
|
|
"src/ast/block_statement.cc",
|
|
|
|
"src/ast/block_statement.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/bool_literal.cc",
|
2020-04-09 18:52:06 +00:00
|
|
|
"src/ast/bool_literal.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/break_statement.cc",
|
|
|
|
"src/ast/break_statement.h",
|
|
|
|
"src/ast/builtin.cc",
|
|
|
|
"src/ast/builtin.h",
|
|
|
|
"src/ast/builtin_decoration.cc",
|
|
|
|
"src/ast/builtin_decoration.h",
|
|
|
|
"src/ast/call_expression.cc",
|
|
|
|
"src/ast/call_expression.h",
|
2020-07-21 13:42:05 +00:00
|
|
|
"src/ast/call_statement.cc",
|
|
|
|
"src/ast/call_statement.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/case_statement.cc",
|
|
|
|
"src/ast/case_statement.h",
|
2020-09-29 18:07:50 +00:00
|
|
|
"src/ast/constant_id_decoration.cc",
|
|
|
|
"src/ast/constant_id_decoration.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/constructor_expression.cc",
|
|
|
|
"src/ast/constructor_expression.h",
|
|
|
|
"src/ast/continue_statement.cc",
|
|
|
|
"src/ast/continue_statement.h",
|
|
|
|
"src/ast/decorated_variable.cc",
|
|
|
|
"src/ast/decorated_variable.h",
|
2020-07-28 15:04:07 +00:00
|
|
|
"src/ast/discard_statement.cc",
|
|
|
|
"src/ast/discard_statement.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/else_statement.cc",
|
|
|
|
"src/ast/else_statement.h",
|
|
|
|
"src/ast/expression.cc",
|
|
|
|
"src/ast/expression.h",
|
|
|
|
"src/ast/fallthrough_statement.cc",
|
|
|
|
"src/ast/fallthrough_statement.h",
|
|
|
|
"src/ast/float_literal.cc",
|
|
|
|
"src/ast/float_literal.h",
|
|
|
|
"src/ast/function.cc",
|
|
|
|
"src/ast/function.h",
|
2020-09-20 19:18:58 +00:00
|
|
|
"src/ast/function_decoration.cc",
|
|
|
|
"src/ast/function_decoration.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/identifier_expression.cc",
|
|
|
|
"src/ast/identifier_expression.h",
|
|
|
|
"src/ast/if_statement.cc",
|
|
|
|
"src/ast/if_statement.h",
|
2020-06-02 20:11:54 +00:00
|
|
|
"src/ast/int_literal.cc",
|
|
|
|
"src/ast/int_literal.h",
|
2020-06-04 17:05:35 +00:00
|
|
|
"src/ast/intrinsic.cc",
|
|
|
|
"src/ast/intrinsic.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/literal.cc",
|
2020-04-09 18:52:06 +00:00
|
|
|
"src/ast/literal.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/location_decoration.cc",
|
|
|
|
"src/ast/location_decoration.h",
|
|
|
|
"src/ast/loop_statement.cc",
|
|
|
|
"src/ast/loop_statement.h",
|
|
|
|
"src/ast/member_accessor_expression.cc",
|
|
|
|
"src/ast/member_accessor_expression.h",
|
|
|
|
"src/ast/module.cc",
|
|
|
|
"src/ast/module.h",
|
|
|
|
"src/ast/node.cc",
|
|
|
|
"src/ast/node.h",
|
2020-05-05 14:21:19 +00:00
|
|
|
"src/ast/null_literal.cc",
|
|
|
|
"src/ast/null_literal.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/pipeline_stage.cc",
|
|
|
|
"src/ast/pipeline_stage.h",
|
|
|
|
"src/ast/return_statement.cc",
|
|
|
|
"src/ast/return_statement.h",
|
|
|
|
"src/ast/scalar_constructor_expression.cc",
|
|
|
|
"src/ast/scalar_constructor_expression.h",
|
|
|
|
"src/ast/set_decoration.cc",
|
|
|
|
"src/ast/set_decoration.h",
|
2020-06-02 20:11:44 +00:00
|
|
|
"src/ast/sint_literal.cc",
|
|
|
|
"src/ast/sint_literal.h",
|
2020-09-21 17:42:10 +00:00
|
|
|
"src/ast/stage_decoration.cc",
|
|
|
|
"src/ast/stage_decoration.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/statement.cc",
|
|
|
|
"src/ast/statement.h",
|
|
|
|
"src/ast/storage_class.cc",
|
|
|
|
"src/ast/storage_class.h",
|
|
|
|
"src/ast/struct.cc",
|
|
|
|
"src/ast/struct.h",
|
2020-04-09 18:52:06 +00:00
|
|
|
"src/ast/struct_decoration.cc",
|
|
|
|
"src/ast/struct_decoration.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/struct_member.cc",
|
|
|
|
"src/ast/struct_member.h",
|
|
|
|
"src/ast/struct_member_decoration.cc",
|
|
|
|
"src/ast/struct_member_decoration.h",
|
|
|
|
"src/ast/struct_member_offset_decoration.cc",
|
|
|
|
"src/ast/struct_member_offset_decoration.h",
|
|
|
|
"src/ast/switch_statement.cc",
|
|
|
|
"src/ast/switch_statement.h",
|
|
|
|
"src/ast/type/alias_type.cc",
|
|
|
|
"src/ast/type/alias_type.h",
|
|
|
|
"src/ast/type/array_type.cc",
|
|
|
|
"src/ast/type/array_type.h",
|
|
|
|
"src/ast/type/bool_type.cc",
|
|
|
|
"src/ast/type/bool_type.h",
|
2020-07-30 23:26:28 +00:00
|
|
|
"src/ast/type/depth_texture_type.cc",
|
|
|
|
"src/ast/type/depth_texture_type.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/type/f32_type.cc",
|
|
|
|
"src/ast/type/f32_type.h",
|
|
|
|
"src/ast/type/i32_type.cc",
|
|
|
|
"src/ast/type/i32_type.h",
|
|
|
|
"src/ast/type/matrix_type.cc",
|
|
|
|
"src/ast/type/matrix_type.h",
|
2020-09-17 03:53:04 +00:00
|
|
|
"src/ast/type/multisampled_texture_type.cc",
|
|
|
|
"src/ast/type/multisampled_texture_type.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/type/pointer_type.cc",
|
|
|
|
"src/ast/type/pointer_type.h",
|
2020-07-30 23:26:28 +00:00
|
|
|
"src/ast/type/sampled_texture_type.cc",
|
|
|
|
"src/ast/type/sampled_texture_type.h",
|
2020-07-30 22:27:25 +00:00
|
|
|
"src/ast/type/sampler_type.cc",
|
|
|
|
"src/ast/type/sampler_type.h",
|
2020-07-30 23:26:28 +00:00
|
|
|
"src/ast/type/storage_texture_type.cc",
|
|
|
|
"src/ast/type/storage_texture_type.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/type/struct_type.cc",
|
|
|
|
"src/ast/type/struct_type.h",
|
2020-07-30 23:26:28 +00:00
|
|
|
"src/ast/type/texture_type.cc",
|
|
|
|
"src/ast/type/texture_type.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/type/type.cc",
|
|
|
|
"src/ast/type/type.h",
|
|
|
|
"src/ast/type/u32_type.cc",
|
|
|
|
"src/ast/type/u32_type.h",
|
|
|
|
"src/ast/type/vector_type.cc",
|
|
|
|
"src/ast/type/vector_type.h",
|
|
|
|
"src/ast/type/void_type.cc",
|
|
|
|
"src/ast/type/void_type.h",
|
2020-04-09 18:52:06 +00:00
|
|
|
"src/ast/type_constructor_expression.cc",
|
|
|
|
"src/ast/type_constructor_expression.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/ast/uint_literal.cc",
|
|
|
|
"src/ast/uint_literal.h",
|
|
|
|
"src/ast/unary_op.cc",
|
|
|
|
"src/ast/unary_op.h",
|
|
|
|
"src/ast/unary_op_expression.cc",
|
|
|
|
"src/ast/unary_op_expression.h",
|
|
|
|
"src/ast/variable.cc",
|
|
|
|
"src/ast/variable.h",
|
|
|
|
"src/ast/variable_decl_statement.cc",
|
|
|
|
"src/ast/variable_decl_statement.h",
|
2020-04-09 18:52:06 +00:00
|
|
|
"src/ast/variable_decoration.cc",
|
|
|
|
"src/ast/variable_decoration.h",
|
2020-09-21 00:28:58 +00:00
|
|
|
"src/ast/workgroup_decoration.cc",
|
|
|
|
"src/ast/workgroup_decoration.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/context.cc",
|
2020-04-09 18:52:06 +00:00
|
|
|
"src/context.h",
|
2020-10-05 14:52:36 +00:00
|
|
|
"src/inspector.cc",
|
|
|
|
"src/inspector.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/reader/reader.cc",
|
|
|
|
"src/reader/reader.h",
|
|
|
|
"src/scope_stack.h",
|
|
|
|
"src/source.h",
|
2020-09-29 18:40:40 +00:00
|
|
|
"src/transform/bound_array_accessors_transform.cc",
|
|
|
|
"src/transform/bound_array_accessors_transform.h",
|
2020-09-29 23:54:03 +00:00
|
|
|
"src/transform/manager.cc",
|
|
|
|
"src/transform/manager.h",
|
2020-09-29 20:28:21 +00:00
|
|
|
"src/transform/transformer.cc",
|
|
|
|
"src/transform/transformer.h",
|
2020-09-24 14:30:34 +00:00
|
|
|
"src/transform/vertex_pulling_transform.cc",
|
|
|
|
"src/transform/vertex_pulling_transform.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/type_determiner.cc",
|
|
|
|
"src/type_determiner.h",
|
|
|
|
"src/type_manager.cc",
|
|
|
|
"src/type_manager.h",
|
|
|
|
"src/validator.cc",
|
|
|
|
"src/validator.h",
|
|
|
|
"src/validator_impl.cc",
|
|
|
|
"src/validator_impl.h",
|
2020-08-25 14:06:05 +00:00
|
|
|
"src/validator_test_helper.cc",
|
|
|
|
"src/validator_test_helper.h",
|
2020-06-23 17:48:40 +00:00
|
|
|
"src/writer/text.cc",
|
|
|
|
"src/writer/text.h",
|
|
|
|
"src/writer/text_generator.cc",
|
|
|
|
"src/writer/text_generator.h",
|
2020-04-08 20:40:25 +00:00
|
|
|
"src/writer/writer.cc",
|
|
|
|
"src/writer/writer.h",
|
|
|
|
]
|
|
|
|
|
2020-07-16 20:13:16 +00:00
|
|
|
public_deps = [
|
2020-04-27 15:31:27 +00:00
|
|
|
":tint_core_enums_unified1",
|
|
|
|
":tint_core_tables_unified1",
|
|
|
|
":tint_language_header_cldebuginfo100",
|
|
|
|
":tint_language_header_debuginfo",
|
2020-07-16 20:13:16 +00:00
|
|
|
"${tint_spirv_headers_dir}:spv_headers",
|
|
|
|
"${tint_spirv_tools_dir}:spvtools_headers",
|
2020-04-27 15:31:27 +00:00
|
|
|
]
|
|
|
|
|
2020-04-09 18:52:06 +00:00
|
|
|
configs += [ ":tint_common_config" ]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-09 18:52:06 +00:00
|
|
|
|
2020-04-08 20:40:25 +00:00
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
source_set("libtint_spv_reader_src") {
|
2020-04-15 20:35:38 +00:00
|
|
|
sources = [
|
2020-04-27 20:14:08 +00:00
|
|
|
"src/reader/spirv/construct.cc",
|
2020-05-14 14:47:51 +00:00
|
|
|
"src/reader/spirv/construct.h",
|
2020-09-22 14:22:12 +00:00
|
|
|
"src/reader/spirv/entry_point_info.h",
|
2020-04-15 20:35:38 +00:00
|
|
|
"src/reader/spirv/enum_converter.cc",
|
|
|
|
"src/reader/spirv/enum_converter.h",
|
|
|
|
"src/reader/spirv/fail_stream.h",
|
|
|
|
"src/reader/spirv/function.cc",
|
|
|
|
"src/reader/spirv/function.h",
|
|
|
|
"src/reader/spirv/namer.cc",
|
|
|
|
"src/reader/spirv/namer.h",
|
|
|
|
"src/reader/spirv/parser.cc",
|
|
|
|
"src/reader/spirv/parser.h",
|
|
|
|
"src/reader/spirv/parser_impl.cc",
|
|
|
|
"src/reader/spirv/parser_impl.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
2020-04-27 15:31:27 +00:00
|
|
|
":tint_core_enums_unified1",
|
|
|
|
":tint_core_tables_unified1",
|
|
|
|
":tint_language_header_cldebuginfo100",
|
|
|
|
":tint_language_header_debuginfo",
|
2020-05-07 17:17:15 +00:00
|
|
|
"${tint_spirv_tools_dir}/:spvtools",
|
2020-04-15 20:35:38 +00:00
|
|
|
"${tint_spirv_tools_dir}/:spvtools_opt",
|
|
|
|
"${tint_spirv_tools_dir}/:spvtools_val",
|
|
|
|
]
|
|
|
|
|
2020-04-27 15:31:27 +00:00
|
|
|
configs += [ ":tint_common_config" ]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-15 20:35:38 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
public_deps = [ ":libtint_core_src" ]
|
2020-04-15 20:35:38 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
source_set("libtint_spv_writer_src") {
|
2020-04-15 20:37:02 +00:00
|
|
|
sources = [
|
|
|
|
"src/writer/spirv/binary_writer.cc",
|
|
|
|
"src/writer/spirv/binary_writer.h",
|
|
|
|
"src/writer/spirv/builder.cc",
|
|
|
|
"src/writer/spirv/builder.h",
|
|
|
|
"src/writer/spirv/function.cc",
|
|
|
|
"src/writer/spirv/function.h",
|
|
|
|
"src/writer/spirv/generator.cc",
|
|
|
|
"src/writer/spirv/generator.h",
|
|
|
|
"src/writer/spirv/instruction.cc",
|
|
|
|
"src/writer/spirv/instruction.h",
|
|
|
|
"src/writer/spirv/operand.cc",
|
|
|
|
"src/writer/spirv/operand.h",
|
|
|
|
]
|
|
|
|
|
2020-04-27 15:31:27 +00:00
|
|
|
configs += [ ":tint_common_config" ]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-15 20:37:02 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
public_deps = [ ":libtint_core_src" ]
|
2020-04-15 20:37:02 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
source_set("libtint_wgsl_reader_src") {
|
2020-04-15 20:47:55 +00:00
|
|
|
sources = [
|
|
|
|
"src/reader/wgsl/lexer.cc",
|
|
|
|
"src/reader/wgsl/lexer.h",
|
|
|
|
"src/reader/wgsl/parser.cc",
|
|
|
|
"src/reader/wgsl/parser.h",
|
|
|
|
"src/reader/wgsl/parser_impl.cc",
|
|
|
|
"src/reader/wgsl/parser_impl.h",
|
|
|
|
"src/reader/wgsl/token.cc",
|
|
|
|
"src/reader/wgsl/token.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs += [ ":tint_common_config" ]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-15 20:47:55 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
public_deps = [ ":libtint_core_src" ]
|
2020-04-15 20:47:55 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
source_set("libtint_wgsl_writer_src") {
|
2020-04-15 20:54:10 +00:00
|
|
|
sources = [
|
|
|
|
"src/writer/wgsl/generator.cc",
|
|
|
|
"src/writer/wgsl/generator.h",
|
|
|
|
"src/writer/wgsl/generator_impl.cc",
|
|
|
|
"src/writer/wgsl/generator_impl.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs += [ ":tint_common_config" ]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-15 20:54:10 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
public_deps = [ ":libtint_core_src" ]
|
2020-04-15 20:54:10 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 17:48:40 +00:00
|
|
|
source_set("libtint_msl_writer_src") {
|
|
|
|
sources = [
|
|
|
|
"src/writer/msl/generator.cc",
|
|
|
|
"src/writer/msl/generator.h",
|
|
|
|
"src/writer/msl/generator_impl.cc",
|
2020-07-02 20:53:45 +00:00
|
|
|
"src/writer/msl/generator_impl.h",
|
|
|
|
"src/writer/msl/namer.cc",
|
|
|
|
"src/writer/msl/namer.h",
|
2020-06-23 17:48:40 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
configs += [ ":tint_common_config" ]
|
2020-07-07 19:11:07 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-06-23 17:48:40 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
public_deps = [ ":libtint_core_src" ]
|
2020-06-23 17:48:40 +00:00
|
|
|
}
|
|
|
|
|
2020-07-20 22:13:37 +00:00
|
|
|
source_set("libtint_hlsl_writer_src") {
|
|
|
|
sources = [
|
|
|
|
"src/writer/hlsl/generator.cc",
|
|
|
|
"src/writer/hlsl/generator.h",
|
|
|
|
"src/writer/hlsl/generator_impl.cc",
|
|
|
|
"src/writer/hlsl/generator_impl.h",
|
2020-07-21 14:51:33 +00:00
|
|
|
"src/writer/hlsl/namer.cc",
|
|
|
|
"src/writer/hlsl/namer.h",
|
2020-07-20 22:13:37 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
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" ]
|
|
|
|
}
|
2020-07-28 15:59:17 +00:00
|
|
|
|
|
|
|
public_deps = [ ":libtint_core_src" ]
|
2020-07-20 22:13:37 +00:00
|
|
|
}
|
|
|
|
|
2020-04-15 20:35:38 +00:00
|
|
|
source_set("libtint") {
|
2020-04-17 13:18:20 +00:00
|
|
|
deps = [ ":libtint_core_src" ]
|
2020-04-15 20:47:55 +00:00
|
|
|
|
2020-04-15 20:35:38 +00:00
|
|
|
if (tint_build_spv_reader) {
|
2020-04-17 13:18:20 +00:00
|
|
|
deps += [ ":libtint_spv_reader_src" ]
|
2020-04-15 20:35:38 +00:00
|
|
|
}
|
|
|
|
|
2020-04-15 20:37:02 +00:00
|
|
|
if (tint_build_spv_writer) {
|
2020-04-17 13:18:20 +00:00
|
|
|
deps += [ ":libtint_spv_writer_src" ]
|
2020-04-15 20:37:02 +00:00
|
|
|
}
|
|
|
|
|
2020-04-15 20:47:55 +00:00
|
|
|
if (tint_build_wgsl_reader) {
|
2020-04-17 13:18:20 +00:00
|
|
|
deps += [ ":libtint_wgsl_reader_src" ]
|
2020-04-15 20:47:55 +00:00
|
|
|
}
|
|
|
|
|
2020-04-15 20:54:10 +00:00
|
|
|
if (tint_build_wgsl_writer) {
|
2020-04-17 13:18:20 +00:00
|
|
|
deps += [ ":libtint_wgsl_writer_src" ]
|
2020-04-15 20:54:10 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 17:48:40 +00:00
|
|
|
if (tint_build_msl_writer) {
|
|
|
|
deps += [ ":libtint_msl_writer_src" ]
|
|
|
|
}
|
|
|
|
|
2020-07-20 22:13:37 +00:00
|
|
|
if (tint_build_hlsl_writer) {
|
|
|
|
deps += [ ":libtint_hlsl_writer_src" ]
|
|
|
|
}
|
|
|
|
|
2020-04-15 20:35:38 +00:00
|
|
|
configs += [ ":tint_common_config" ]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-15 20:35:38 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
###############################################################################
|
|
|
|
# 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",
|
|
|
|
"${tint_googletest_dir}/googlemock/src/gmock_main.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",
|
2020-07-16 20:13:16 +00:00
|
|
|
"//third_party/googletest:gmock",
|
2020-04-17 13:18:20 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-22 17:36:39 +00:00
|
|
|
###############################################################################
|
|
|
|
# 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)
|
|
|
|
if (build_with_chromium) {
|
|
|
|
source_set("tint_unittests_main") {
|
|
|
|
testonly = true
|
|
|
|
deps = [ ":gmock_and_gtest" ]
|
|
|
|
sources = [ "//gpu/tint_unittests_main.cc" ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
###############################################################################
|
|
|
|
# Tests - For libtint core and optional modules
|
|
|
|
###############################################################################
|
|
|
|
config("tint_unittests_config") {
|
|
|
|
include_dirs = [
|
|
|
|
"${tint_googletest_dir}/googlemock/include",
|
|
|
|
"${tint_googletest_dir}/googletest/include",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
source_set("tint_unittests_core_src") {
|
|
|
|
sources = [
|
|
|
|
"src/ast/array_accessor_expression_test.cc",
|
|
|
|
"src/ast/assignment_statement_test.cc",
|
|
|
|
"src/ast/binary_expression_test.cc",
|
|
|
|
"src/ast/binding_decoration_test.cc",
|
2020-09-22 22:07:13 +00:00
|
|
|
"src/ast/bitcast_expression_test.cc",
|
2020-07-27 15:25:00 +00:00
|
|
|
"src/ast/block_statement_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/bool_literal_test.cc",
|
|
|
|
"src/ast/break_statement_test.cc",
|
|
|
|
"src/ast/builtin_decoration_test.cc",
|
|
|
|
"src/ast/call_expression_test.cc",
|
2020-07-21 13:42:05 +00:00
|
|
|
"src/ast/call_statement_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/case_statement_test.cc",
|
2020-09-29 18:07:50 +00:00
|
|
|
"src/ast/constant_id_decoration_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/continue_statement_test.cc",
|
|
|
|
"src/ast/decorated_variable_test.cc",
|
2020-07-28 15:59:17 +00:00
|
|
|
"src/ast/discard_statement_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/else_statement_test.cc",
|
2020-04-22 00:23:49 +00:00
|
|
|
"src/ast/expression_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/fallthrough_statement_test.cc",
|
|
|
|
"src/ast/float_literal_test.cc",
|
|
|
|
"src/ast/function_test.cc",
|
|
|
|
"src/ast/identifier_expression_test.cc",
|
|
|
|
"src/ast/if_statement_test.cc",
|
2020-06-02 20:11:54 +00:00
|
|
|
"src/ast/int_literal_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/location_decoration_test.cc",
|
|
|
|
"src/ast/loop_statement_test.cc",
|
|
|
|
"src/ast/member_accessor_expression_test.cc",
|
|
|
|
"src/ast/module_test.cc",
|
2020-05-05 14:21:19 +00:00
|
|
|
"src/ast/null_literal_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/return_statement_test.cc",
|
|
|
|
"src/ast/scalar_constructor_expression_test.cc",
|
|
|
|
"src/ast/set_decoration_test.cc",
|
2020-06-02 20:11:44 +00:00
|
|
|
"src/ast/sint_literal_test.cc",
|
2020-09-21 17:42:10 +00:00
|
|
|
"src/ast/stage_decoration_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/struct_member_offset_decoration_test.cc",
|
|
|
|
"src/ast/struct_member_test.cc",
|
|
|
|
"src/ast/struct_test.cc",
|
|
|
|
"src/ast/switch_statement_test.cc",
|
|
|
|
"src/ast/type/alias_type_test.cc",
|
|
|
|
"src/ast/type/array_type_test.cc",
|
|
|
|
"src/ast/type/bool_type_test.cc",
|
2020-07-30 23:26:28 +00:00
|
|
|
"src/ast/type/depth_texture_type_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/type/f32_type_test.cc",
|
|
|
|
"src/ast/type/i32_type_test.cc",
|
|
|
|
"src/ast/type/matrix_type_test.cc",
|
2020-09-17 03:53:04 +00:00
|
|
|
"src/ast/type/multisampled_texture_type_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/type/pointer_type_test.cc",
|
2020-07-30 23:26:28 +00:00
|
|
|
"src/ast/type/sampled_texture_type_test.cc",
|
2020-07-30 22:27:25 +00:00
|
|
|
"src/ast/type/sampler_type_test.cc",
|
2020-07-30 23:26:28 +00:00
|
|
|
"src/ast/type/storage_texture_type_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/ast/type/struct_type_test.cc",
|
|
|
|
"src/ast/type/u32_type_test.cc",
|
|
|
|
"src/ast/type/vector_type_test.cc",
|
|
|
|
"src/ast/type_constructor_expression_test.cc",
|
|
|
|
"src/ast/uint_literal_test.cc",
|
|
|
|
"src/ast/unary_op_expression_test.cc",
|
|
|
|
"src/ast/variable_decl_statement_test.cc",
|
|
|
|
"src/ast/variable_test.cc",
|
2020-09-21 00:28:58 +00:00
|
|
|
"src/ast/workgroup_decoration_test.cc",
|
2020-10-05 14:52:36 +00:00
|
|
|
"src/inspector_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/scope_stack_test.cc",
|
2020-09-29 18:40:40 +00:00
|
|
|
"src/transform/bound_array_accessors_transform_test.cc",
|
2020-09-24 14:30:34 +00:00
|
|
|
"src/transform/vertex_pulling_transform_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/type_determiner_test.cc",
|
|
|
|
"src/type_manager_test.cc",
|
2020-09-02 19:58:06 +00:00
|
|
|
"src/validator_control_block_test.cc",
|
2020-08-12 19:31:42 +00:00
|
|
|
"src/validator_function_test.cc",
|
2020-07-22 12:59:19 +00:00
|
|
|
"src/validator_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":gmock_and_gtest",
|
|
|
|
":libtint_core_src",
|
|
|
|
]
|
2020-04-17 13:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
source_set("tint_unittests_spv_reader_src") {
|
|
|
|
sources = [
|
|
|
|
"src/reader/spirv/enum_converter_test.cc",
|
|
|
|
"src/reader/spirv/fail_stream_test.cc",
|
|
|
|
"src/reader/spirv/function_arithmetic_test.cc",
|
2020-04-21 17:44:44 +00:00
|
|
|
"src/reader/spirv/function_bit_test.cc",
|
2020-07-20 22:19:01 +00:00
|
|
|
"src/reader/spirv/function_call_test.cc",
|
2020-04-21 17:44:44 +00:00
|
|
|
"src/reader/spirv/function_cfg_test.cc",
|
2020-06-12 15:09:56 +00:00
|
|
|
"src/reader/spirv/function_composite_test.cc",
|
2020-04-20 21:06:43 +00:00
|
|
|
"src/reader/spirv/function_conversion_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/spirv/function_decl_test.cc",
|
2020-06-12 15:09:14 +00:00
|
|
|
"src/reader/spirv/function_glsl_std_450_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/spirv/function_logical_test.cc",
|
|
|
|
"src/reader/spirv/function_memory_test.cc",
|
2020-06-22 20:48:59 +00:00
|
|
|
"src/reader/spirv/function_misc_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/spirv/function_var_test.cc",
|
|
|
|
"src/reader/spirv/namer_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_convert_member_decoration_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_convert_type_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_function_decl_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_get_decorations_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_import_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_module_var_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_named_types_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_test.cc",
|
|
|
|
"src/reader/spirv/parser_impl_user_name_test.cc",
|
|
|
|
"src/reader/spirv/parser_test.cc",
|
|
|
|
"src/reader/spirv/spirv_tools_helpers_test.cc",
|
|
|
|
"src/reader/spirv/spirv_tools_helpers_test.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":gmock_and_gtest",
|
|
|
|
":libtint_spv_reader_src",
|
|
|
|
]
|
2020-04-17 13:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
source_set("tint_unittests_spv_writer_src") {
|
|
|
|
sources = [
|
|
|
|
"src/writer/spirv/binary_writer_test.cc",
|
2020-04-22 14:07:05 +00:00
|
|
|
"src/writer/spirv/builder_accessor_expression_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/spirv/builder_assign_test.cc",
|
|
|
|
"src/writer/spirv/builder_binary_expression_test.cc",
|
2020-09-22 22:07:13 +00:00
|
|
|
"src/writer/spirv/builder_bitcast_expression_test.cc",
|
2020-07-27 15:25:00 +00:00
|
|
|
"src/writer/spirv/builder_block_test.cc",
|
2020-04-20 15:46:18 +00:00
|
|
|
"src/writer/spirv/builder_call_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/spirv/builder_constructor_expression_test.cc",
|
2020-07-25 14:32:44 +00:00
|
|
|
"src/writer/spirv/builder_discard_test.cc",
|
2020-08-31 15:49:43 +00:00
|
|
|
"src/writer/spirv/builder_format_conversion_test.cc",
|
2020-09-21 18:49:01 +00:00
|
|
|
"src/writer/spirv/builder_function_decoration_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/spirv/builder_function_test.cc",
|
|
|
|
"src/writer/spirv/builder_function_variable_test.cc",
|
|
|
|
"src/writer/spirv/builder_global_variable_test.cc",
|
|
|
|
"src/writer/spirv/builder_ident_expression_test.cc",
|
|
|
|
"src/writer/spirv/builder_if_test.cc",
|
2020-06-04 17:05:35 +00:00
|
|
|
"src/writer/spirv/builder_intrinsic_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/spirv/builder_literal_test.cc",
|
2020-04-20 14:07:29 +00:00
|
|
|
"src/writer/spirv/builder_loop_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/spirv/builder_return_test.cc",
|
2020-06-01 18:56:34 +00:00
|
|
|
"src/writer/spirv/builder_switch_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/spirv/builder_test.cc",
|
|
|
|
"src/writer/spirv/builder_type_test.cc",
|
2020-04-22 00:24:11 +00:00
|
|
|
"src/writer/spirv/builder_unary_op_expression_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/spirv/instruction_test.cc",
|
|
|
|
"src/writer/spirv/operand_test.cc",
|
|
|
|
"src/writer/spirv/spv_dump.cc",
|
|
|
|
"src/writer/spirv/spv_dump.h",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":gmock_and_gtest",
|
|
|
|
":libtint_spv_writer_src",
|
|
|
|
]
|
2020-04-17 13:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
source_set("tint_unittests_wgsl_reader_src") {
|
|
|
|
sources = [
|
|
|
|
"src/reader/wgsl/lexer_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_additive_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_and_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_argument_expression_list_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_assignment_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_body_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_break_stmt_test.cc",
|
2020-07-21 15:13:36 +00:00
|
|
|
"src/reader/wgsl/parser_impl_call_stmt_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_case_body_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_const_expr_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_const_literal_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_continue_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_continuing_stmt_test.cc",
|
2020-09-02 14:06:45 +00:00
|
|
|
"src/reader/wgsl/parser_impl_depth_texture_type_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_else_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_elseif_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_equality_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_exclusive_or_expression_test.cc",
|
2020-08-24 18:22:22 +00:00
|
|
|
"src/reader/wgsl/parser_impl_for_stmt_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_function_decl_test.cc",
|
2020-09-21 00:37:08 +00:00
|
|
|
"src/reader/wgsl/parser_impl_function_decoration_list_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_function_decoration_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_function_header_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_function_type_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_global_constant_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_global_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_global_variable_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_if_stmt_test.cc",
|
2020-09-08 16:38:39 +00:00
|
|
|
"src/reader/wgsl/parser_impl_image_storage_type_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_inclusive_or_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_logical_and_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_logical_or_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_loop_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_multiplicative_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_param_list_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_paren_rhs_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_pipeline_stage_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_postfix_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_primary_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_relational_expression_test.cc",
|
2020-09-02 15:52:15 +00:00
|
|
|
"src/reader/wgsl/parser_impl_sampled_texture_type_test.cc",
|
2020-09-02 13:26:15 +00:00
|
|
|
"src/reader/wgsl/parser_impl_sampler_type_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_shift_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_statement_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_statements_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_storage_class_test.cc",
|
2020-09-08 16:48:09 +00:00
|
|
|
"src/reader/wgsl/parser_impl_storage_texture_type_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_struct_body_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_struct_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_struct_decoration_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_struct_decoration_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_struct_member_decoration_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_struct_member_decoration_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_struct_member_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_switch_body_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_switch_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_test_helper.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_test_helper.h",
|
2020-09-02 14:16:35 +00:00
|
|
|
"src/reader/wgsl/parser_impl_texture_sampler_types_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/reader/wgsl/parser_impl_type_alias_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_type_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_unary_expression_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_variable_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_variable_decoration_list_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_variable_decoration_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_variable_ident_decl_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_variable_stmt_test.cc",
|
|
|
|
"src/reader/wgsl/parser_impl_variable_storage_decoration_test.cc",
|
|
|
|
"src/reader/wgsl/parser_test.cc",
|
|
|
|
"src/reader/wgsl/token_test.cc",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":gmock_and_gtest",
|
|
|
|
":libtint_wgsl_reader_src",
|
|
|
|
]
|
2020-04-17 13:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
source_set("tint_unittests_wgsl_writer_src") {
|
|
|
|
sources = [
|
|
|
|
"src/writer/wgsl/generator_impl_alias_type_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_array_accessor_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_assign_test.cc",
|
2020-06-23 18:22:05 +00:00
|
|
|
"src/writer/wgsl/generator_impl_binary_test.cc",
|
2020-09-22 22:07:13 +00:00
|
|
|
"src/writer/wgsl/generator_impl_bitcast_test.cc",
|
2020-07-27 15:25:00 +00:00
|
|
|
"src/writer/wgsl/generator_impl_block_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/wgsl/generator_impl_break_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_call_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_case_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_cast_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_constructor_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_continue_test.cc",
|
2020-07-25 14:33:04 +00:00
|
|
|
"src/writer/wgsl/generator_impl_discard_test.cc",
|
2020-04-17 13:18:20 +00:00
|
|
|
"src/writer/wgsl/generator_impl_fallthrough_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_function_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_identifier_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_if_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_loop_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_member_accessor_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_return_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_switch_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_type_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_unary_op_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_variable_decl_statement_test.cc",
|
|
|
|
"src/writer/wgsl/generator_impl_variable_test.cc",
|
|
|
|
]
|
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":gmock_and_gtest",
|
|
|
|
":libtint_wgsl_writer_src",
|
|
|
|
]
|
2020-04-17 13:18:20 +00:00
|
|
|
}
|
|
|
|
|
2020-06-23 17:48:40 +00:00
|
|
|
source_set("tint_unittests_msl_writer_src") {
|
2020-06-23 17:48:53 +00:00
|
|
|
sources = [
|
2020-06-26 21:27:59 +00:00
|
|
|
"src/writer/msl/generator_impl_alias_type_test.cc",
|
2020-06-26 21:27:59 +00:00
|
|
|
"src/writer/msl/generator_impl_array_accessor_test.cc",
|
2020-06-23 17:54:33 +00:00
|
|
|
"src/writer/msl/generator_impl_assign_test.cc",
|
2020-06-23 18:22:05 +00:00
|
|
|
"src/writer/msl/generator_impl_binary_test.cc",
|
2020-09-22 22:07:13 +00:00
|
|
|
"src/writer/msl/generator_impl_bitcast_test.cc",
|
2020-07-27 15:25:00 +00:00
|
|
|
"src/writer/msl/generator_impl_block_test.cc",
|
2020-06-29 21:17:54 +00:00
|
|
|
"src/writer/msl/generator_impl_break_test.cc",
|
2020-07-14 20:37:38 +00:00
|
|
|
"src/writer/msl/generator_impl_call_test.cc",
|
2020-06-30 21:33:20 +00:00
|
|
|
"src/writer/msl/generator_impl_case_test.cc",
|
2020-06-26 21:27:59 +00:00
|
|
|
"src/writer/msl/generator_impl_cast_test.cc",
|
2020-06-23 18:22:21 +00:00
|
|
|
"src/writer/msl/generator_impl_constructor_test.cc",
|
2020-06-29 21:17:54 +00:00
|
|
|
"src/writer/msl/generator_impl_continue_test.cc",
|
2020-07-25 14:32:54 +00:00
|
|
|
"src/writer/msl/generator_impl_discard_test.cc",
|
2020-09-21 18:58:01 +00:00
|
|
|
"src/writer/msl/generator_impl_function_entry_point_data_test.cc",
|
2020-06-23 17:54:25 +00:00
|
|
|
"src/writer/msl/generator_impl_function_test.cc",
|
2020-06-23 17:49:08 +00:00
|
|
|
"src/writer/msl/generator_impl_identifier_test.cc",
|
2020-06-26 21:27:59 +00:00
|
|
|
"src/writer/msl/generator_impl_if_test.cc",
|
2020-07-20 22:13:00 +00:00
|
|
|
"src/writer/msl/generator_impl_import_test.cc",
|
2020-07-25 14:39:23 +00:00
|
|
|
"src/writer/msl/generator_impl_intrinsic_test.cc",
|
2020-06-30 17:40:28 +00:00
|
|
|
"src/writer/msl/generator_impl_loop_test.cc",
|
2020-06-29 21:17:44 +00:00
|
|
|
"src/writer/msl/generator_impl_member_accessor_test.cc",
|
2020-07-20 19:54:23 +00:00
|
|
|
"src/writer/msl/generator_impl_module_constant_test.cc",
|
2020-06-23 17:49:00 +00:00
|
|
|
"src/writer/msl/generator_impl_return_test.cc",
|
2020-06-30 21:33:20 +00:00
|
|
|
"src/writer/msl/generator_impl_switch_test.cc",
|
2020-06-23 17:48:53 +00:00
|
|
|
"src/writer/msl/generator_impl_test.cc",
|
|
|
|
"src/writer/msl/generator_impl_type_test.cc",
|
2020-06-26 21:27:59 +00:00
|
|
|
"src/writer/msl/generator_impl_unary_op_test.cc",
|
2020-07-08 20:52:46 +00:00
|
|
|
"src/writer/msl/generator_impl_variable_decl_statement_test.cc",
|
2020-07-02 20:53:45 +00:00
|
|
|
"src/writer/msl/namer_test.cc",
|
2020-06-23 17:48:53 +00:00
|
|
|
]
|
2020-06-23 17:48:40 +00:00
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
|
|
|
public_configs = [ ":tint_public_config" ]
|
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-16 20:13:16 +00:00
|
|
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":gmock_and_gtest",
|
|
|
|
":libtint_msl_writer_src",
|
|
|
|
]
|
2020-06-23 17:48:40 +00:00
|
|
|
}
|
|
|
|
|
2020-07-20 22:13:37 +00:00
|
|
|
source_set("tint_unittests_hlsl_writer_src") {
|
2020-07-21 14:51:33 +00:00
|
|
|
sources = [
|
2020-07-29 18:56:25 +00:00
|
|
|
"src/writer/hlsl/generator_impl_alias_type_test.cc",
|
2020-07-29 18:56:35 +00:00
|
|
|
"src/writer/hlsl/generator_impl_array_accessor_test.cc",
|
2020-07-21 15:58:56 +00:00
|
|
|
"src/writer/hlsl/generator_impl_assign_test.cc",
|
2020-07-21 15:58:20 +00:00
|
|
|
"src/writer/hlsl/generator_impl_binary_test.cc",
|
2020-09-22 22:07:13 +00:00
|
|
|
"src/writer/hlsl/generator_impl_bitcast_test.cc",
|
2020-07-29 19:06:46 +00:00
|
|
|
"src/writer/hlsl/generator_impl_block_test.cc",
|
2020-07-21 15:58:29 +00:00
|
|
|
"src/writer/hlsl/generator_impl_break_test.cc",
|
2020-08-19 17:44:45 +00:00
|
|
|
"src/writer/hlsl/generator_impl_call_test.cc",
|
2020-07-21 15:58:43 +00:00
|
|
|
"src/writer/hlsl/generator_impl_case_test.cc",
|
2020-08-19 19:14:44 +00:00
|
|
|
"src/writer/hlsl/generator_impl_cast_test.cc",
|
2020-07-29 18:50:18 +00:00
|
|
|
"src/writer/hlsl/generator_impl_constructor_test.cc",
|
2020-07-21 15:58:29 +00:00
|
|
|
"src/writer/hlsl/generator_impl_continue_test.cc",
|
2020-07-29 18:56:50 +00:00
|
|
|
"src/writer/hlsl/generator_impl_discard_test.cc",
|
2020-09-22 13:47:32 +00:00
|
|
|
"src/writer/hlsl/generator_impl_function_entry_point_data_test.cc",
|
2020-08-19 17:32:25 +00:00
|
|
|
"src/writer/hlsl/generator_impl_function_test.cc",
|
2020-07-21 14:51:33 +00:00
|
|
|
"src/writer/hlsl/generator_impl_identifier_test.cc",
|
2020-07-30 22:26:55 +00:00
|
|
|
"src/writer/hlsl/generator_impl_if_test.cc",
|
2020-08-19 19:19:04 +00:00
|
|
|
"src/writer/hlsl/generator_impl_import_test.cc",
|
2020-08-19 19:17:54 +00:00
|
|
|
"src/writer/hlsl/generator_impl_intrinsic_test.cc",
|
2020-07-30 22:27:09 +00:00
|
|
|
"src/writer/hlsl/generator_impl_loop_test.cc",
|
2020-07-29 19:12:19 +00:00
|
|
|
"src/writer/hlsl/generator_impl_member_accessor_test.cc",
|
2020-08-19 19:03:24 +00:00
|
|
|
"src/writer/hlsl/generator_impl_module_constant_test.cc",
|
2020-07-21 15:58:29 +00:00
|
|
|
"src/writer/hlsl/generator_impl_return_test.cc",
|
2020-07-21 15:58:50 +00:00
|
|
|
"src/writer/hlsl/generator_impl_switch_test.cc",
|
2020-07-21 14:51:33 +00:00
|
|
|
"src/writer/hlsl/generator_impl_test.cc",
|
2020-07-29 18:30:44 +00:00
|
|
|
"src/writer/hlsl/generator_impl_type_test.cc",
|
2020-07-21 15:58:36 +00:00
|
|
|
"src/writer/hlsl/generator_impl_unary_op_test.cc",
|
2020-07-30 22:26:46 +00:00
|
|
|
"src/writer/hlsl/generator_impl_variable_decl_statement_test.cc",
|
2020-07-21 14:51:33 +00:00
|
|
|
"src/writer/hlsl/namer_test.cc",
|
2020-08-26 19:05:46 +00:00
|
|
|
"src/writer/hlsl/test_helper.h",
|
2020-07-21 14:51:33 +00:00
|
|
|
]
|
2020-07-20 22:13:37 +00:00
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
|
|
|
public_configs = [ ":tint_public_config" ]
|
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
2020-07-28 15:59:17 +00:00
|
|
|
|
|
|
|
testonly = true
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
":gmock_and_gtest",
|
|
|
|
":libtint_hlsl_writer_src",
|
|
|
|
]
|
2020-07-20 22:13:37 +00:00
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
source_set("tint_unittests_src") {
|
2020-07-16 20:13:16 +00:00
|
|
|
testonly = true
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
deps = [ ":tint_unittests_core_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" ]
|
|
|
|
}
|
|
|
|
|
2020-06-23 17:48:40 +00:00
|
|
|
if (tint_build_msl_writer) {
|
|
|
|
deps += [ ":tint_unittests_msl_writer_src" ]
|
|
|
|
}
|
|
|
|
|
2020-07-29 18:50:06 +00:00
|
|
|
if (tint_build_hlsl_writer) {
|
|
|
|
deps += [ ":tint_unittests_hlsl_writer_src" ]
|
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
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",
|
2020-05-07 17:17:15 +00:00
|
|
|
"${tint_spirv_tools_dir}/:spvtools",
|
|
|
|
"${tint_spirv_tools_dir}/:spvtools_opt",
|
|
|
|
"${tint_spirv_tools_dir}/:spvtools_val",
|
2020-04-17 13:18:20 +00:00
|
|
|
]
|
|
|
|
|
2020-07-22 17:36:39 +00:00
|
|
|
if (build_with_chromium) {
|
|
|
|
deps += [ ":tint_unittests_main" ]
|
|
|
|
}
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
|
|
|
":tint_unittests_config",
|
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-17 13:18:20 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
testonly = true
|
|
|
|
}
|
|
|
|
|
2020-04-27 15:31:27 +00:00
|
|
|
###############################################################################
|
|
|
|
# Fuzzers - Libfuzzer based fuzzing targets for Chromium
|
|
|
|
###############################################################################
|
|
|
|
# To run the fuzzers outside of Chromium, use the CMake based builds.
|
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
import("//testing/libfuzzer/fuzzer_test.gni")
|
|
|
|
|
2020-07-30 21:24:29 +00:00
|
|
|
# fuzzer_test doesn't have configs members, so need to define them in an empty
|
|
|
|
# source_set.
|
2020-07-30 18:43:48 +00:00
|
|
|
|
2020-07-30 21:24:29 +00:00
|
|
|
source_set("tint_fuzzer_common") {
|
2020-04-27 15:31:27 +00:00
|
|
|
configs += [ ":tint_common_config" ]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-07-30 21:24:29 +00:00
|
|
|
}
|
2020-04-27 15:31:27 +00:00
|
|
|
|
2020-07-30 21:24:29 +00:00
|
|
|
if (tint_build_wgsl_reader) {
|
|
|
|
fuzzer_test("tint_wgsl_reader_fuzzer") {
|
|
|
|
sources = [ "fuzzers/tint_wgsl_reader_fuzzer.cc" ]
|
|
|
|
deps = [
|
|
|
|
":libtint_wgsl_reader_src",
|
|
|
|
":tint_fuzzer_common",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tint_build_spv_reader) {
|
|
|
|
fuzzer_test("tint_spv_reader_fuzzer") {
|
|
|
|
sources = [ "fuzzers/tint_spv_reader_fuzzer.cc" ]
|
|
|
|
deps = [
|
|
|
|
":libtint_spv_reader_src",
|
|
|
|
":tint_fuzzer_common",
|
|
|
|
]
|
|
|
|
}
|
2020-04-27 15:31:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-17 13:18:20 +00:00
|
|
|
###############################################################################
|
|
|
|
# Samples - Executables exposing command line functionality
|
|
|
|
###############################################################################
|
|
|
|
|
2020-07-30 18:44:14 +00:00
|
|
|
config("tint_config") {
|
2020-04-15 20:47:55 +00:00
|
|
|
include_dirs = []
|
|
|
|
if (tint_build_spv_reader || tint_build_spv_writer) {
|
2020-04-27 15:31:27 +00:00
|
|
|
include_dirs += [ "${tint_spirv_tools_dir}/include/" ]
|
2020-04-15 20:47:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-30 18:44:14 +00:00
|
|
|
executable("tint") {
|
2020-04-09 18:52:06 +00:00
|
|
|
sources = [ "samples/main.cc" ]
|
2020-05-07 17:17:15 +00:00
|
|
|
deps = [
|
|
|
|
":libtint",
|
|
|
|
"${tint_spirv_tools_dir}/:spvtools",
|
|
|
|
"${tint_spirv_tools_dir}/:spvtools_opt",
|
|
|
|
"${tint_spirv_tools_dir}/:spvtools_val",
|
|
|
|
]
|
2020-04-09 18:52:06 +00:00
|
|
|
|
2020-04-27 15:31:27 +00:00
|
|
|
configs += [
|
|
|
|
":tint_common_config",
|
2020-07-30 18:44:14 +00:00
|
|
|
":tint_config",
|
2020-04-27 15:31:27 +00:00
|
|
|
]
|
2020-06-16 17:26:59 +00:00
|
|
|
public_configs = [ ":tint_public_config" ]
|
2020-04-08 20:40:25 +00:00
|
|
|
|
|
|
|
if (build_with_chromium) {
|
|
|
|
configs -= [ "//build/config/compiler:chromium_code" ]
|
|
|
|
configs += [ "//build/config/compiler:no_chromium_code" ]
|
|
|
|
}
|
|
|
|
}
|