Fix gn check in Chromium

- Move headers from libtint_sem_src into libtint_core_all_src so that
there is no circular header dependency between headers of these two
targets. libtint_sem_src is now just a hack to have a different name for
a few .cc files.
 - Made libtint_core_src publicly depend on its deps so that headers of
libtint_core_all_src are made visible through it.
 - Added spvtools dependencies in a couple places that were mistakenly
removed in a previous commit.
 - Moved helpers common to multiple unittest targets out of
tint_unittests_core_src and into a tint_test_helpers target that
all tint_unittests_source_set depend on.
 - Ran GN format that reordered some lists a bit.

Bug: None
Change-Id: I544a73d73366be9dd2ac8e56c7593fd9f2b86cf8
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/48600
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Corentin Wallez 2021-04-21 09:18:52 +00:00 committed by Commit Bot service account
parent de8f1332f6
commit c0810e7e6e
2 changed files with 81 additions and 68 deletions

View File

@ -253,31 +253,6 @@ template("libtint_source_set") {
} }
} }
libtint_source_set("libtint_sem_src") {
sources = [
"sem/array.cc",
"sem/array.h",
"sem/call.cc",
"sem/call.h",
"sem/call_target.cc",
"sem/call_target.h",
"sem/expression.cc",
"sem/expression.h",
"sem/function.cc",
"sem/info.cc",
"sem/info.h",
"sem/intrinsic.cc",
"sem/intrinsic.h",
"sem/member_accessor_expression.cc",
"sem/node.cc",
"sem/node.h",
"sem/statement.cc",
"sem/struct.cc",
"sem/type_mappings.h",
"sem/variable.cc",
]
}
libtint_source_set("libtint_core_all_src") { libtint_source_set("libtint_core_all_src") {
sources = [ sources = [
"ast/access_control.cc", "ast/access_control.cc",
@ -286,12 +261,13 @@ libtint_source_set("libtint_core_all_src") {
"ast/access_decoration.h", "ast/access_decoration.h",
"ast/alias.cc", "ast/alias.cc",
"ast/alias.h", "ast/alias.h",
"ast/array_accessor_expression.cc",
"ast/array_accessor_expression.h",
"ast/array.cc", "ast/array.cc",
"ast/array.h", "ast/array.h",
"ast/array_accessor_expression.cc",
"ast/array_accessor_expression.h",
"ast/assignment_statement.cc", "ast/assignment_statement.cc",
"ast/assignment_statement.h", "ast/assignment_statement.h",
"ast/ast_type.cc", # TODO(bclayton) - rename to type.cc
"ast/binary_expression.cc", "ast/binary_expression.cc",
"ast/binary_expression.h", "ast/binary_expression.h",
"ast/binding_decoration.cc", "ast/binding_decoration.cc",
@ -300,16 +276,16 @@ libtint_source_set("libtint_core_all_src") {
"ast/bitcast_expression.h", "ast/bitcast_expression.h",
"ast/block_statement.cc", "ast/block_statement.cc",
"ast/block_statement.h", "ast/block_statement.h",
"ast/bool_literal.cc",
"ast/bool_literal.h",
"ast/bool.cc", "ast/bool.cc",
"ast/bool.h", "ast/bool.h",
"ast/bool_literal.cc",
"ast/bool_literal.h",
"ast/break_statement.cc", "ast/break_statement.cc",
"ast/break_statement.h", "ast/break_statement.h",
"ast/builtin_decoration.cc",
"ast/builtin_decoration.h",
"ast/builtin.cc", "ast/builtin.cc",
"ast/builtin.h", "ast/builtin.h",
"ast/builtin_decoration.cc",
"ast/builtin_decoration.h",
"ast/call_expression.cc", "ast/call_expression.cc",
"ast/call_expression.h", "ast/call_expression.h",
"ast/call_statement.cc", "ast/call_statement.cc",
@ -392,38 +368,37 @@ libtint_source_set("libtint_core_all_src") {
"ast/storage_texture.h", "ast/storage_texture.h",
"ast/stride_decoration.cc", "ast/stride_decoration.cc",
"ast/stride_decoration.h", "ast/stride_decoration.h",
"ast/struct.cc",
"ast/struct.h",
"ast/struct_block_decoration.cc", "ast/struct_block_decoration.cc",
"ast/struct_block_decoration.h", "ast/struct_block_decoration.h",
"ast/struct_member.cc",
"ast/struct_member.h",
"ast/struct_member_align_decoration.cc", "ast/struct_member_align_decoration.cc",
"ast/struct_member_align_decoration.h", "ast/struct_member_align_decoration.h",
"ast/struct_member_offset_decoration.cc", "ast/struct_member_offset_decoration.cc",
"ast/struct_member_offset_decoration.h", "ast/struct_member_offset_decoration.h",
"ast/struct_member_size_decoration.cc", "ast/struct_member_size_decoration.cc",
"ast/struct_member_size_decoration.h", "ast/struct_member_size_decoration.h",
"ast/struct_member.cc",
"ast/struct_member.h",
"ast/struct.cc",
"ast/struct.h",
"ast/switch_statement.cc", "ast/switch_statement.cc",
"ast/switch_statement.h", "ast/switch_statement.h",
"ast/texture.cc", "ast/texture.cc",
"ast/texture.h", "ast/texture.h",
"ast/type.h",
"ast/type_constructor_expression.cc", "ast/type_constructor_expression.cc",
"ast/type_constructor_expression.h", "ast/type_constructor_expression.h",
"ast/ast_type.cc", # TODO(bclayton) - rename to type.cc
"ast/type.h",
"ast/u32.cc", "ast/u32.cc",
"ast/u32.h", "ast/u32.h",
"ast/uint_literal.cc", "ast/uint_literal.cc",
"ast/uint_literal.h", "ast/uint_literal.h",
"ast/unary_op_expression.cc",
"ast/unary_op_expression.h",
"ast/unary_op.cc", "ast/unary_op.cc",
"ast/unary_op.h", "ast/unary_op.h",
"ast/variable_decl_statement.cc", "ast/unary_op_expression.cc",
"ast/variable_decl_statement.h", "ast/unary_op_expression.h",
"ast/variable.cc", "ast/variable.cc",
"ast/variable.h", "ast/variable.h",
"ast/variable_decl_statement.cc",
"ast/variable_decl_statement.h",
"ast/vector.cc", "ast/vector.cc",
"ast/vector.h", "ast/vector.h",
"ast/void.cc", "ast/void.cc",
@ -453,12 +428,12 @@ libtint_source_set("libtint_core_all_src") {
"inspector/scalar.h", "inspector/scalar.h",
"intrinsic_table.cc", "intrinsic_table.cc",
"intrinsic_table.h", "intrinsic_table.h",
"program.cc",
"program.h",
"program_builder.cc", "program_builder.cc",
"program_builder.h", "program_builder.h",
"program_id.cc", "program_id.cc",
"program_id.h", "program_id.h",
"program.cc",
"program.h",
"reader/reader.cc", "reader/reader.cc",
"reader/reader.h", "reader/reader.h",
"resolver/resolver.cc", "resolver/resolver.cc",
@ -468,22 +443,29 @@ libtint_source_set("libtint_core_all_src") {
"sem/access_control_type.h", "sem/access_control_type.h",
"sem/alias_type.cc", "sem/alias_type.cc",
"sem/alias_type.h", "sem/alias_type.h",
"sem/array.h",
"sem/array_type.cc", "sem/array_type.cc",
"sem/array_type.h", "sem/array_type.h",
"sem/bool_type.cc", "sem/bool_type.cc",
"sem/bool_type.h", "sem/bool_type.h",
"sem/call.h",
"sem/call_target.h",
"sem/depth_texture_type.cc", "sem/depth_texture_type.cc",
"sem/depth_texture_type.h", "sem/depth_texture_type.h",
"sem/expression.h",
"sem/external_texture_type.cc", "sem/external_texture_type.cc",
"sem/external_texture_type.h", "sem/external_texture_type.h",
"sem/f32_type.cc", "sem/f32_type.cc",
"sem/f32_type.h", "sem/f32_type.h",
"sem/i32_type.cc", "sem/i32_type.cc",
"sem/i32_type.h", "sem/i32_type.h",
"sem/info.h",
"sem/intrinsic.h",
"sem/matrix_type.cc", "sem/matrix_type.cc",
"sem/matrix_type.h", "sem/matrix_type.h",
"sem/multisampled_texture_type.cc", "sem/multisampled_texture_type.cc",
"sem/multisampled_texture_type.h", "sem/multisampled_texture_type.h",
"sem/node.h",
"sem/pointer_type.cc", "sem/pointer_type.cc",
"sem/pointer_type.h", "sem/pointer_type.h",
"sem/sampled_texture_type.cc", "sem/sampled_texture_type.cc",
@ -500,6 +482,7 @@ libtint_source_set("libtint_core_all_src") {
"sem/type.h", "sem/type.h",
"sem/type_manager.cc", "sem/type_manager.cc",
"sem/type_manager.h", "sem/type_manager.h",
"sem/type_mappings.h",
"sem/u32_type.cc", "sem/u32_type.cc",
"sem/u32_type.h", "sem/u32_type.h",
"sem/vector_type.cc", "sem/vector_type.cc",
@ -508,10 +491,10 @@ libtint_source_set("libtint_core_all_src") {
"sem/void_type.h", "sem/void_type.h",
"source.cc", "source.cc",
"source.h", "source.h",
"symbol_table.cc",
"symbol_table.h",
"symbol.cc", "symbol.cc",
"symbol.h", "symbol.h",
"symbol_table.cc",
"symbol_table.h",
"traits.h", "traits.h",
"transform/binding_point.h", "transform/binding_point.h",
"transform/binding_remapper.cc", "transform/binding_remapper.cc",
@ -544,10 +527,10 @@ libtint_source_set("libtint_core_all_src") {
"writer/append_vector.h", "writer/append_vector.h",
"writer/float_to_string.cc", "writer/float_to_string.cc",
"writer/float_to_string.h", "writer/float_to_string.h",
"writer/text_generator.cc",
"writer/text_generator.h",
"writer/text.cc", "writer/text.cc",
"writer/text.h", "writer/text.h",
"writer/text_generator.cc",
"writer/text_generator.h",
"writer/writer.cc", "writer/writer.cc",
"writer/writer.h", "writer/writer.h",
] ]
@ -561,8 +544,27 @@ libtint_source_set("libtint_core_all_src") {
} }
} }
libtint_source_set("libtint_sem_src") {
sources = [
"sem/array.cc",
"sem/call.cc",
"sem/call_target.cc",
"sem/expression.cc",
"sem/function.cc",
"sem/info.cc",
"sem/intrinsic.cc",
"sem/member_accessor_expression.cc",
"sem/node.cc",
"sem/statement.cc",
"sem/struct.cc",
"sem/variable.cc",
]
public_deps = [ ":libtint_core_all_src" ]
}
libtint_source_set("libtint_core_src") { libtint_source_set("libtint_core_src") {
deps = [ public_deps = [
":libtint_core_all_src", ":libtint_core_all_src",
":libtint_sem_src", ":libtint_sem_src",
] ]
@ -588,7 +590,10 @@ libtint_source_set("libtint_spv_reader_src") {
"reader/spirv/usage.h", "reader/spirv/usage.h",
] ]
public_deps = [ ":libtint_core_src" ] public_deps = [
":libtint_core_src",
"${tint_spirv_tools_dir}/:spvtools_opt",
]
} }
libtint_source_set("libtint_spv_writer_src") { libtint_source_set("libtint_spv_writer_src") {

View File

@ -107,6 +107,27 @@ config("tint_unittests_config") {
] ]
} }
source_set("tint_test_helpers") {
sources = [
"../src/ast/intrinsic_texture_helper_test.cc",
"../src/ast/intrinsic_texture_helper_test.h",
"../src/transform/test_helper.h",
"../src/utils/command.h",
"../src/utils/tmpfile.h",
]
if (is_linux || is_mac) {
sources += [ "../src/utils/command_posix.cc" ]
sources += [ "../src/utils/tmpfile_posix.cc" ]
} else if (is_win) {
sources += [ "../src/utils/command_windows.cc" ]
sources += [ "../src/utils/tmpfile_windows.cc" ]
} else {
sources += [ "../src/utils/command_other.cc" ]
sources += [ "../src/utils/tmpfile_other.cc" ]
}
}
template("tint_unittests_source_set") { template("tint_unittests_source_set") {
source_set(target_name) { source_set(target_name) {
forward_variables_from(invoker, "*", [ "configs" ]) forward_variables_from(invoker, "*", [ "configs" ])
@ -127,6 +148,7 @@ template("tint_unittests_source_set") {
} }
deps += [ deps += [
":gmock_and_gtest", ":gmock_and_gtest",
":tint_test_helpers",
"${tint_root_dir}/src:libtint_core_src", "${tint_root_dir}/src:libtint_core_src",
] ]
} }
@ -169,8 +191,6 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/ast/identifier_expression_test.cc", "../src/ast/identifier_expression_test.cc",
"../src/ast/if_statement_test.cc", "../src/ast/if_statement_test.cc",
"../src/ast/int_literal_test.cc", "../src/ast/int_literal_test.cc",
"../src/ast/intrinsic_texture_helper_test.cc",
"../src/ast/intrinsic_texture_helper_test.h",
"../src/ast/location_decoration_test.cc", "../src/ast/location_decoration_test.cc",
"../src/ast/loop_statement_test.cc", "../src/ast/loop_statement_test.cc",
"../src/ast/matrix_test.cc", "../src/ast/matrix_test.cc",
@ -224,9 +244,9 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/resolver/intrinsic_test.cc", "../src/resolver/intrinsic_test.cc",
"../src/resolver/is_host_shareable_test.cc", "../src/resolver/is_host_shareable_test.cc",
"../src/resolver/is_storeable_test.cc", "../src/resolver/is_storeable_test.cc",
"../src/resolver/resolver_test.cc",
"../src/resolver/resolver_test_helper.cc", "../src/resolver/resolver_test_helper.cc",
"../src/resolver/resolver_test_helper.h", "../src/resolver/resolver_test_helper.h",
"../src/resolver/resolver_test.cc",
"../src/resolver/storage_class_validation_test.cc", "../src/resolver/storage_class_validation_test.cc",
"../src/resolver/struct_layout_test.cc", "../src/resolver/struct_layout_test.cc",
"../src/resolver/struct_pipeline_stage_use_test.cc", "../src/resolver/struct_pipeline_stage_use_test.cc",
@ -265,32 +285,17 @@ tint_unittests_source_set("tint_unittests_core_src") {
"../src/transform/emit_vertex_point_size_test.cc", "../src/transform/emit_vertex_point_size_test.cc",
"../src/transform/first_index_offset_test.cc", "../src/transform/first_index_offset_test.cc",
"../src/transform/renamer_test.cc", "../src/transform/renamer_test.cc",
"../src/transform/test_helper.h",
"../src/transform/vertex_pulling_test.cc", "../src/transform/vertex_pulling_test.cc",
"../src/utils/command.h",
"../src/utils/command_test.cc", "../src/utils/command_test.cc",
"../src/utils/command.h",
"../src/utils/get_or_create_test.cc", "../src/utils/get_or_create_test.cc",
"../src/utils/hash_test.cc", "../src/utils/hash_test.cc",
"../src/utils/math_test.cc", "../src/utils/math_test.cc",
"../src/utils/tmpfile_test.cc", "../src/utils/tmpfile_test.cc",
"../src/utils/tmpfile.h",
"../src/utils/unique_vector_test.cc", "../src/utils/unique_vector_test.cc",
"../src/writer/append_vector_test.cc", "../src/writer/append_vector_test.cc",
"../src/writer/float_to_string_test.cc", "../src/writer/float_to_string_test.cc",
] ]
if (is_linux || is_mac) {
sources += [ "../src/utils/command_posix.cc" ]
sources += [ "../src/utils/tmpfile_posix.cc" ]
} else if (is_win) {
sources += [ "../src/utils/command_windows.cc" ]
sources += [ "../src/utils/tmpfile_windows.cc" ]
} else {
sources += [ "../src/utils/command_other.cc" ]
sources += [ "../src/utils/tmpfile_other.cc" ]
}
deps = [ deps = [
":tint_unittests_core_sem_src", ":tint_unittests_core_sem_src",
"${tint_root_dir}/src:libtint_wgsl_reader_src", "${tint_root_dir}/src:libtint_wgsl_reader_src",
@ -372,7 +377,10 @@ tint_unittests_source_set("tint_unittests_spv_writer_src") {
"../src/writer/spirv/test_helper.h", "../src/writer/spirv/test_helper.h",
] ]
deps = [ "${tint_root_dir}/src:libtint_spv_writer_src" ] deps = [
"${tint_root_dir}/src:libtint_spv_writer_src",
"${tint_spirv_tools_dir}/:spvtools",
]
} }
tint_unittests_source_set("tint_unittests_wgsl_reader_src") { tint_unittests_source_set("tint_unittests_wgsl_reader_src") {