Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 1 | # Copyright 2020 The Tint Authors. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
dan sinclair | 4b71b9e | 2020-03-18 14:08:48 +0000 | [diff] [blame] | 15 | function(tint_spvtools_compile_options TARGET) |
| 16 | # We'll use the optimizer for its nice SPIR-V in-memory representation |
| 17 | target_link_libraries(${TARGET} SPIRV-Tools-opt SPIRV-Tools) |
| 18 | |
| 19 | # We'll be cheating: using internal interfaces to the SPIRV-Tools |
| 20 | # optimizer. |
| 21 | target_include_directories(${TARGET} PRIVATE |
| 22 | ${spirv-tools_SOURCE_DIR} |
| 23 | ${spirv-tools_BINARY_DIR} |
| 24 | ) |
| 25 | |
| 26 | if (${CMAKE_CXX_COMPILER_ID} MATCHES Clang) |
| 27 | # The SPIRV-Tools code is conditioned against C++ and an older version of Clang. |
| 28 | # Suppress warnings triggered in our current compilation environment. |
| 29 | # TODO(dneto): Fix the issues upstream. |
| 30 | target_compile_options(${TARGET} PRIVATE |
| 31 | -Wno-newline-eof |
| 32 | -Wno-sign-conversion |
| 33 | -Wno-old-style-cast |
| 34 | -Wno-weak-vtables |
| 35 | ) |
| 36 | endif() |
| 37 | endfunction() |
| 38 | |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 39 | set(TINT_LIB_SRCS |
Ryan Harrison | be45ff5 | 2020-06-11 19:35:20 +0000 | [diff] [blame] | 40 | ../include/tint/tint.h |
dan sinclair | c55fc39 | 2020-10-29 13:36:32 +0000 | [diff] [blame] | 41 | ast/access_control.cc |
| 42 | ast/access_control.h |
dan sinclair | 7214f40 | 2020-11-19 18:55:01 +0000 | [diff] [blame] | 43 | ast/access_decoration.cc |
| 44 | ast/access_decoration.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 45 | ast/array_accessor_expression.cc |
| 46 | ast/array_accessor_expression.h |
dan sinclair | eb5d3e1 | 2020-10-08 19:34:25 +0000 | [diff] [blame] | 47 | ast/array_decoration.cc |
| 48 | ast/array_decoration.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 49 | ast/assignment_statement.cc |
| 50 | ast/assignment_statement.h |
dan sinclair | 1c9b486 | 2020-04-07 19:27:41 +0000 | [diff] [blame] | 51 | ast/binary_expression.cc |
| 52 | ast/binary_expression.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 53 | ast/binding_decoration.cc |
| 54 | ast/binding_decoration.h |
dan sinclair | a7d498e | 2020-09-22 22:07:13 +0000 | [diff] [blame] | 55 | ast/bitcast_expression.cc |
| 56 | ast/bitcast_expression.h |
dan sinclair | 775cb51 | 2020-07-27 15:25:00 +0000 | [diff] [blame] | 57 | ast/block_statement.cc |
| 58 | ast/block_statement.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 59 | ast/bool_literal.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 60 | ast/bool_literal.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 61 | ast/break_statement.cc |
| 62 | ast/break_statement.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 63 | ast/builtin_decoration.cc |
| 64 | ast/builtin_decoration.h |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 65 | ast/builtin.cc |
| 66 | ast/builtin.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 67 | ast/call_expression.cc |
| 68 | ast/call_expression.h |
dan sinclair | 2e40491 | 2020-07-21 13:42:05 +0000 | [diff] [blame] | 69 | ast/call_statement.cc |
| 70 | ast/call_statement.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 71 | ast/case_statement.cc |
| 72 | ast/case_statement.h |
dan sinclair | 9e7f9dc | 2020-09-29 18:07:50 +0000 | [diff] [blame] | 73 | ast/constant_id_decoration.cc |
| 74 | ast/constant_id_decoration.h |
dan sinclair | a322f5d | 2020-03-30 22:46:06 +0000 | [diff] [blame] | 75 | ast/constructor_expression.cc |
| 76 | ast/constructor_expression.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 77 | ast/continue_statement.cc |
| 78 | ast/continue_statement.h |
Ben Clayton | 3529880 | 2020-11-03 21:40:20 +0000 | [diff] [blame] | 79 | ast/decoration.cc |
| 80 | ast/decoration.h |
dan sinclair | b4374c2 | 2020-07-25 03:34:33 +0000 | [diff] [blame] | 81 | ast/discard_statement.cc |
| 82 | ast/discard_statement.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 83 | ast/else_statement.cc |
| 84 | ast/else_statement.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 85 | ast/expression.cc |
| 86 | ast/expression.h |
| 87 | ast/fallthrough_statement.cc |
| 88 | ast/fallthrough_statement.h |
| 89 | ast/float_literal.cc |
| 90 | ast/float_literal.h |
| 91 | ast/function.cc |
| 92 | ast/function.h |
dan sinclair | 636d588 | 2020-09-20 19:18:58 +0000 | [diff] [blame] | 93 | ast/function_decoration.cc |
| 94 | ast/function_decoration.h |
dan sinclair | c068cfc | 2021-01-15 12:22:16 +0000 | [diff] [blame] | 95 | ast/group_decoration.cc |
| 96 | ast/group_decoration.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 97 | ast/identifier_expression.cc |
| 98 | ast/identifier_expression.h |
| 99 | ast/if_statement.cc |
| 100 | ast/if_statement.h |
dan sinclair | e009c20 | 2020-06-02 20:11:54 +0000 | [diff] [blame] | 101 | ast/int_literal.cc |
| 102 | ast/int_literal.h |
dan sinclair | 3e7dc82 | 2020-06-04 17:05:35 +0000 | [diff] [blame] | 103 | ast/intrinsic.cc |
| 104 | ast/intrinsic.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 105 | ast/literal.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 106 | ast/literal.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 107 | ast/location_decoration.cc |
| 108 | ast/location_decoration.h |
| 109 | ast/loop_statement.cc |
| 110 | ast/loop_statement.h |
| 111 | ast/member_accessor_expression.cc |
| 112 | ast/member_accessor_expression.h |
| 113 | ast/module.cc |
| 114 | ast/module.h |
| 115 | ast/node.cc |
| 116 | ast/node.h |
dan sinclair | 2287f33 | 2020-05-05 14:21:19 +0000 | [diff] [blame] | 117 | ast/null_literal.cc |
| 118 | ast/null_literal.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 119 | ast/pipeline_stage.cc |
| 120 | ast/pipeline_stage.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 121 | ast/return_statement.cc |
| 122 | ast/return_statement.h |
dan sinclair | a322f5d | 2020-03-30 22:46:06 +0000 | [diff] [blame] | 123 | ast/scalar_constructor_expression.cc |
| 124 | ast/scalar_constructor_expression.h |
dan sinclair | c6f2947 | 2020-06-02 20:11:44 +0000 | [diff] [blame] | 125 | ast/sint_literal.cc |
| 126 | ast/sint_literal.h |
dan sinclair | 767ea85 | 2020-09-21 17:42:10 +0000 | [diff] [blame] | 127 | ast/stage_decoration.cc |
| 128 | ast/stage_decoration.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 129 | ast/statement.cc |
| 130 | ast/statement.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 131 | ast/storage_class.cc |
| 132 | ast/storage_class.h |
dan sinclair | eb5d3e1 | 2020-10-08 19:34:25 +0000 | [diff] [blame] | 133 | ast/stride_decoration.cc |
| 134 | ast/stride_decoration.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 135 | ast/struct.cc |
| 136 | ast/struct.h |
Ben Clayton | 3529880 | 2020-11-03 21:40:20 +0000 | [diff] [blame] | 137 | ast/struct_block_decoration.cc |
| 138 | ast/struct_block_decoration.h |
dan sinclair | eb5d3e1 | 2020-10-08 19:34:25 +0000 | [diff] [blame] | 139 | ast/struct_decoration.cc |
| 140 | ast/struct_decoration.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 141 | ast/struct_member.cc |
| 142 | ast/struct_member.h |
| 143 | ast/struct_member_decoration.cc |
| 144 | ast/struct_member_decoration.h |
| 145 | ast/struct_member_offset_decoration.cc |
| 146 | ast/struct_member_offset_decoration.h |
| 147 | ast/switch_statement.cc |
| 148 | ast/switch_statement.h |
dan sinclair | a322f5d | 2020-03-30 22:46:06 +0000 | [diff] [blame] | 149 | ast/type_constructor_expression.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 150 | ast/type_constructor_expression.h |
dan sinclair | 7214f40 | 2020-11-19 18:55:01 +0000 | [diff] [blame] | 151 | ast/type_decoration.cc |
| 152 | ast/type_decoration.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 153 | ast/uint_literal.cc |
| 154 | ast/uint_literal.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 155 | ast/unary_op.cc |
| 156 | ast/unary_op.h |
| 157 | ast/unary_op_expression.cc |
| 158 | ast/unary_op_expression.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 159 | ast/variable.cc |
| 160 | ast/variable.h |
| 161 | ast/variable_decoration.cc |
| 162 | ast/variable_decoration.h |
dan sinclair | e49bd5e | 2020-03-30 22:46:48 +0000 | [diff] [blame] | 163 | ast/variable_decl_statement.cc |
| 164 | ast/variable_decl_statement.h |
dan sinclair | 6438279 | 2020-09-21 00:28:58 +0000 | [diff] [blame] | 165 | ast/workgroup_decoration.cc |
| 166 | ast/workgroup_decoration.h |
Ben Clayton | 587f387 | 2021-01-21 15:30:10 +0000 | [diff] [blame] | 167 | block_allocator.h |
Ben Clayton | 95feb99 | 2020-11-30 22:50:25 +0000 | [diff] [blame] | 168 | castable.cc |
| 169 | castable.h |
Ben Clayton | 1e29f4b | 2021-01-21 16:20:40 +0000 | [diff] [blame] | 170 | clone_context.cc |
| 171 | clone_context.h |
dan sinclair | 2d0282b | 2020-12-11 18:29:03 +0000 | [diff] [blame] | 172 | demangler.cc |
| 173 | demangler.h; |
Ben Clayton | f0740ae | 2020-11-02 15:41:08 +0000 | [diff] [blame] | 174 | diagnostic/diagnostic.cc |
| 175 | diagnostic/diagnostic.h |
| 176 | diagnostic/formatter.cc |
| 177 | diagnostic/formatter.h |
Ben Clayton | 2e6cc99 | 2020-11-02 19:26:28 +0000 | [diff] [blame] | 178 | diagnostic/printer.cc |
| 179 | diagnostic/printer.h |
Ryan Harrison | 8904253 | 2020-10-16 02:26:54 +0000 | [diff] [blame] | 180 | inspector/entry_point.cc |
| 181 | inspector/entry_point.h |
| 182 | inspector/inspector.cc |
| 183 | inspector/inspector.h |
| 184 | inspector/scalar.cc |
| 185 | inspector/scalar.h |
dan sinclair | 84f8275 | 2020-11-10 21:49:56 +0000 | [diff] [blame] | 186 | namer.cc |
| 187 | namer.h |
Ben Clayton | a6b9a8e | 2021-01-26 16:57:10 +0000 | [diff] [blame] | 188 | program_builder.cc |
| 189 | program_builder.h |
Ben Clayton | c40f627 | 2021-01-26 16:57:10 +0000 | [diff] [blame] | 190 | program.cc |
Ben Clayton | d59cedb | 2021-01-25 18:14:08 +0000 | [diff] [blame] | 191 | program.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 192 | reader/reader.cc |
| 193 | reader/reader.h |
dan sinclair | c2d97ae | 2020-04-03 02:35:23 +0000 | [diff] [blame] | 194 | scope_stack.h |
Ben Clayton | 5c18662 | 2021-01-29 15:46:42 +0000 | [diff] [blame] | 195 | semantic/expression.h |
Ben Clayton | dd1b6fc | 2021-01-29 10:55:40 +0000 | [diff] [blame] | 196 | semantic/info.h |
Ben Clayton | 7fdfff1 | 2021-01-29 15:17:30 +0000 | [diff] [blame] | 197 | semantic/node.h |
Ben Clayton | 5c18662 | 2021-01-29 15:46:42 +0000 | [diff] [blame] | 198 | semantic/sem_expression.cc |
Ben Clayton | dd1b6fc | 2021-01-29 10:55:40 +0000 | [diff] [blame] | 199 | semantic/sem_info.cc |
Ben Clayton | 5c18662 | 2021-01-29 15:46:42 +0000 | [diff] [blame] | 200 | semantic/sem_node.cc |
| 201 | semantic/type_mappings.h |
Ben Clayton | 5bee67f | 2020-10-30 20:44:53 +0000 | [diff] [blame] | 202 | source.cc |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 203 | source.h |
dan sinclair | 89caee1 | 2020-12-10 16:56:02 +0000 | [diff] [blame] | 204 | symbol.cc |
| 205 | symbol.h |
| 206 | symbol_table.cc |
| 207 | symbol_table.h |
Ben Clayton | 1e29f4b | 2021-01-21 16:20:40 +0000 | [diff] [blame] | 208 | traits.h |
Ben Clayton | 00b77a8 | 2020-12-04 09:06:09 +0000 | [diff] [blame] | 209 | transform/emit_vertex_point_size.cc |
| 210 | transform/emit_vertex_point_size.h |
| 211 | transform/bound_array_accessors.cc |
| 212 | transform/bound_array_accessors.h |
Enrico Galli | 3d449d2 | 2020-12-08 21:07:24 +0000 | [diff] [blame] | 213 | transform/first_index_offset.cc |
| 214 | transform/first_index_offset.h |
dan sinclair | 5bb9b75 | 2020-09-29 23:54:03 +0000 | [diff] [blame] | 215 | transform/manager.cc |
| 216 | transform/manager.h |
Ben Clayton | 00b77a8 | 2020-12-04 09:06:09 +0000 | [diff] [blame] | 217 | transform/transform.cc |
| 218 | transform/transform.h |
| 219 | transform/vertex_pulling.cc |
| 220 | transform/vertex_pulling.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 221 | type_determiner.cc |
| 222 | type_determiner.h |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 223 | type/access_control_type.cc |
| 224 | type/access_control_type.h |
| 225 | type/alias_type.cc |
| 226 | type/alias_type.h |
| 227 | type/array_type.cc |
| 228 | type/array_type.h |
| 229 | type/bool_type.cc |
| 230 | type/bool_type.h |
| 231 | type/depth_texture_type.cc |
| 232 | type/depth_texture_type.h |
| 233 | type/f32_type.cc |
| 234 | type/f32_type.h |
| 235 | type/i32_type.cc |
| 236 | type/i32_type.h |
| 237 | type/matrix_type.cc |
| 238 | type/matrix_type.h |
| 239 | type/multisampled_texture_type.cc |
| 240 | type/multisampled_texture_type.h |
| 241 | type/pointer_type.cc |
| 242 | type/pointer_type.h |
| 243 | type/sampled_texture_type.cc |
| 244 | type/sampled_texture_type.h |
| 245 | type/sampler_type.cc |
| 246 | type/sampler_type.h |
| 247 | type/storage_texture_type.cc |
| 248 | type/storage_texture_type.h |
| 249 | type/struct_type.cc |
| 250 | type/struct_type.h |
| 251 | type/texture_type.cc |
| 252 | type/texture_type.h |
| 253 | type/type.cc |
| 254 | type/type.h |
| 255 | type/type_manager.cc |
| 256 | type/type_manager.h |
| 257 | type/u32_type.cc |
| 258 | type/u32_type.h |
| 259 | type/vector_type.cc |
| 260 | type/vector_type.h |
| 261 | type/void_type.cc |
| 262 | type/void_type.h |
Sarah Mashayekhi | 34f90a0 | 2020-11-06 17:31:15 +0000 | [diff] [blame] | 263 | validator/validator.cc |
| 264 | validator/validator.h |
| 265 | validator/validator_impl.cc |
| 266 | validator/validator_impl.h |
| 267 | validator/validator_test_helper.cc |
| 268 | validator/validator_test_helper.h |
Ben Clayton | 7f04e5c | 2020-12-09 15:57:00 +0000 | [diff] [blame] | 269 | writer/append_vector.cc |
| 270 | writer/append_vector.h |
Ben Clayton | 2da833d | 2020-11-20 10:04:44 +0000 | [diff] [blame] | 271 | writer/float_to_string.cc |
| 272 | writer/float_to_string.h |
dan sinclair | 2a59901 | 2020-06-23 17:48:40 +0000 | [diff] [blame] | 273 | writer/text.cc |
| 274 | writer/text.h |
| 275 | writer/text_generator.cc |
| 276 | writer/text_generator.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 277 | writer/writer.cc |
| 278 | writer/writer.h |
| 279 | ) |
| 280 | |
Ben Clayton | 2e6cc99 | 2020-11-02 19:26:28 +0000 | [diff] [blame] | 281 | if(UNIX) |
| 282 | list(APPEND TINT_LIB_SRCS diagnostic/printer_linux.cc) |
| 283 | elseif(WIN32) |
| 284 | list(APPEND TINT_LIB_SRCS diagnostic/printer_windows.cc) |
| 285 | else() |
| 286 | list(APPEND TINT_LIB_SRCS diagnostic/printer_other.cc) |
| 287 | endif() |
| 288 | |
dan sinclair | 4b71b9e | 2020-03-18 14:08:48 +0000 | [diff] [blame] | 289 | if(${TINT_BUILD_SPV_READER}) |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 290 | list(APPEND TINT_LIB_SRCS |
David Neto | a92c114 | 2020-04-27 20:14:08 +0000 | [diff] [blame] | 291 | reader/spirv/construct.h |
| 292 | reader/spirv/construct.cc |
dan sinclair | de2a019 | 2020-09-22 14:22:12 +0000 | [diff] [blame] | 293 | reader/spirv/entry_point_info.h |
David Neto | 14cfcd7 | 2020-03-23 22:53:42 +0000 | [diff] [blame] | 294 | reader/spirv/enum_converter.h |
| 295 | reader/spirv/enum_converter.cc |
David Neto | 4e7f7da | 2020-03-17 20:07:41 +0000 | [diff] [blame] | 296 | reader/spirv/fail_stream.h |
David Neto | e70e109 | 2020-04-07 19:54:52 +0000 | [diff] [blame] | 297 | reader/spirv/function.cc |
| 298 | reader/spirv/function.h |
David Neto | be4c89a | 2020-03-20 19:24:23 +0000 | [diff] [blame] | 299 | reader/spirv/namer.cc |
| 300 | reader/spirv/namer.h |
David Neto | 4e7f7da | 2020-03-17 20:07:41 +0000 | [diff] [blame] | 301 | reader/spirv/parser.cc |
| 302 | reader/spirv/parser.h |
| 303 | reader/spirv/parser_impl.cc |
| 304 | reader/spirv/parser_impl.h |
David Neto | bd7ab2c | 2020-11-17 18:32:18 +0000 | [diff] [blame] | 305 | reader/spirv/usage.cc |
| 306 | reader/spirv/usage.h |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 307 | ) |
| 308 | endif() |
| 309 | |
dan sinclair | 4b71b9e | 2020-03-18 14:08:48 +0000 | [diff] [blame] | 310 | if(${TINT_BUILD_WGSL_READER}) |
| 311 | list(APPEND TINT_LIB_SRCS |
| 312 | reader/wgsl/lexer.cc |
| 313 | reader/wgsl/lexer.h |
| 314 | reader/wgsl/parser.cc |
| 315 | reader/wgsl/parser.h |
| 316 | reader/wgsl/parser_impl.cc |
| 317 | reader/wgsl/parser_impl.h |
Ben Clayton | 0573714 | 2020-11-09 20:44:34 +0000 | [diff] [blame] | 318 | reader/wgsl/parser_impl_detail.h |
dan sinclair | 4b71b9e | 2020-03-18 14:08:48 +0000 | [diff] [blame] | 319 | reader/wgsl/token.cc |
| 320 | reader/wgsl/token.h |
| 321 | ) |
| 322 | endif() |
| 323 | |
| 324 | if(${TINT_BUILD_SPV_WRITER}) |
| 325 | list(APPEND TINT_LIB_SRCS |
| 326 | writer/spirv/binary_writer.cc |
| 327 | writer/spirv/binary_writer.h |
| 328 | writer/spirv/builder.cc |
| 329 | writer/spirv/builder.h |
dan sinclair | baaf989 | 2020-04-01 23:40:53 +0000 | [diff] [blame] | 330 | writer/spirv/function.cc |
| 331 | writer/spirv/function.h |
dan sinclair | 4b71b9e | 2020-03-18 14:08:48 +0000 | [diff] [blame] | 332 | writer/spirv/generator.cc |
| 333 | writer/spirv/generator.h |
| 334 | writer/spirv/instruction.cc |
| 335 | writer/spirv/instruction.h |
| 336 | writer/spirv/operand.cc |
| 337 | writer/spirv/operand.h |
| 338 | ) |
| 339 | endif() |
| 340 | |
| 341 | if(${TINT_BUILD_WGSL_WRITER}) |
| 342 | list(APPEND TINT_LIB_SRCS |
| 343 | writer/wgsl/generator.cc |
| 344 | writer/wgsl/generator.h |
| 345 | writer/wgsl/generator_impl.cc |
| 346 | writer/wgsl/generator_impl.h |
| 347 | ) |
| 348 | endif() |
| 349 | |
dan sinclair | 2a59901 | 2020-06-23 17:48:40 +0000 | [diff] [blame] | 350 | if(${TINT_BUILD_MSL_WRITER}) |
| 351 | list(APPEND TINT_LIB_SRCS |
| 352 | writer/msl/generator.cc |
| 353 | writer/msl/generator.h |
| 354 | writer/msl/generator_impl.cc |
| 355 | writer/msl/generator_impl.h |
dan sinclair | 987376c | 2021-01-12 04:34:53 +0000 | [diff] [blame] | 356 | writer/msl/namer.cc |
| 357 | writer/msl/namer.h |
dan sinclair | 2a59901 | 2020-06-23 17:48:40 +0000 | [diff] [blame] | 358 | ) |
| 359 | endif() |
| 360 | |
dan sinclair | feffa9d | 2020-07-20 22:13:37 +0000 | [diff] [blame] | 361 | if(${TINT_BUILD_HLSL_WRITER}) |
| 362 | list(APPEND TINT_LIB_SRCS |
| 363 | writer/hlsl/generator.cc |
| 364 | writer/hlsl/generator.h |
| 365 | writer/hlsl/generator_impl.cc |
| 366 | writer/hlsl/generator_impl.h |
dan sinclair | 987376c | 2021-01-12 04:34:53 +0000 | [diff] [blame] | 367 | writer/hlsl/namer.cc |
| 368 | writer/hlsl/namer.h |
dan sinclair | feffa9d | 2020-07-20 22:13:37 +0000 | [diff] [blame] | 369 | ) |
| 370 | endif() |
| 371 | |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 372 | ## Tint library |
| 373 | add_library(libtint ${TINT_LIB_SRCS}) |
| 374 | tint_default_compile_options(libtint) |
dan sinclair | b8d90ea | 2020-10-06 15:11:17 +0000 | [diff] [blame] | 375 | if (${COMPILER_IS_LIKE_GNU}) |
| 376 | target_compile_options(libtint PRIVATE -fvisibility=hidden) |
| 377 | endif() |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 378 | set_target_properties(libtint PROPERTIES OUTPUT_NAME "tint") |
| 379 | |
Ben Clayton | 12ed862 | 2020-11-24 15:28:06 +0000 | [diff] [blame] | 380 | if (${TINT_BUILD_FUZZERS}) |
| 381 | # Tint library with fuzzer instrumentation |
| 382 | add_library(libtint-fuzz ${TINT_LIB_SRCS}) |
| 383 | tint_default_compile_options(libtint-fuzz) |
| 384 | if (${COMPILER_IS_LIKE_GNU}) |
| 385 | target_compile_options(libtint-fuzz PRIVATE -fvisibility=hidden) |
| 386 | endif() |
| 387 | target_compile_options(libtint-fuzz PUBLIC -fsanitize=fuzzer -fsanitize-coverage=trace-cmp) |
| 388 | target_link_options(libtint-fuzz PUBLIC -fsanitize=fuzzer -fsanitize-coverage=trace-cmp) |
| 389 | endif() |
| 390 | |
Ben Clayton | 7fbd67a | 2020-12-10 14:33:31 +0000 | [diff] [blame] | 391 | if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER}) |
| 392 | tint_spvtools_compile_options(libtint) |
| 393 | if (${TINT_BUILD_FUZZERS}) |
| 394 | tint_spvtools_compile_options(libtint-fuzz) |
| 395 | endif() |
| 396 | endif() |
| 397 | |
David Neto | c82eeee | 2020-12-09 18:15:30 +0000 | [diff] [blame] | 398 | if(${TINT_BUILD_TESTS}) |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 399 | set(TINT_TEST_SRCS |
Ben Clayton | 1523f5c | 2020-12-14 22:30:57 +0000 | [diff] [blame] | 400 | ast/access_decoration_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 401 | ast/array_accessor_expression_test.cc |
| 402 | ast/assignment_statement_test.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 403 | ast/binary_expression_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 404 | ast/binding_decoration_test.cc |
| 405 | ast/bitcast_expression_test.cc |
| 406 | ast/block_statement_test.cc |
| 407 | ast/bool_literal_test.cc |
| 408 | ast/break_statement_test.cc |
| 409 | ast/builtin_decoration_test.cc |
| 410 | ast/call_expression_test.cc |
| 411 | ast/call_statement_test.cc |
| 412 | ast/case_statement_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 413 | ast/constant_id_decoration_test.cc |
| 414 | ast/continue_statement_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 415 | ast/decoration_test.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 416 | ast/discard_statement_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 417 | ast/else_statement_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 418 | ast/fallthrough_statement_test.cc |
| 419 | ast/float_literal_test.cc |
| 420 | ast/function_test.cc |
dan sinclair | c068cfc | 2021-01-15 12:22:16 +0000 | [diff] [blame] | 421 | ast/group_decoration_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 422 | ast/identifier_expression_test.cc |
| 423 | ast/if_statement_test.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 424 | ast/int_literal_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 425 | ast/intrinsic_texture_helper_test.cc |
| 426 | ast/intrinsic_texture_helper_test.h |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 427 | ast/location_decoration_test.cc |
| 428 | ast/loop_statement_test.cc |
| 429 | ast/member_accessor_expression_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 430 | ast/module_clone_test.cc |
Ben Clayton | a6b9a8e | 2021-01-26 16:57:10 +0000 | [diff] [blame] | 431 | ast/module_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 432 | ast/null_literal_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 433 | ast/return_statement_test.cc |
| 434 | ast/scalar_constructor_expression_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 435 | ast/sint_literal_test.cc |
| 436 | ast/stage_decoration_test.cc |
| 437 | ast/stride_decoration_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 438 | ast/struct_member_offset_decoration_test.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 439 | ast/struct_member_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 440 | ast/struct_test.cc |
| 441 | ast/switch_statement_test.cc |
| 442 | ast/test_helper.h |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 443 | ast/type_constructor_expression_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 444 | ast/uint_literal_test.cc |
| 445 | ast/unary_op_expression_test.cc |
| 446 | ast/variable_decl_statement_test.cc |
| 447 | ast/variable_test.cc |
| 448 | ast/workgroup_decoration_test.cc |
Ben Clayton | 587f387 | 2021-01-21 15:30:10 +0000 | [diff] [blame] | 449 | block_allocator_test.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 450 | castable_test.cc |
Ben Clayton | 1e29f4b | 2021-01-21 16:20:40 +0000 | [diff] [blame] | 451 | clone_context_test.cc |
dan sinclair | 2d0282b | 2020-12-11 18:29:03 +0000 | [diff] [blame] | 452 | demangler_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 453 | diagnostic/formatter_test.cc |
| 454 | diagnostic/printer_test.cc |
| 455 | inspector/inspector_test.cc |
| 456 | namer_test.cc |
Ben Clayton | c40f627 | 2021-01-26 16:57:10 +0000 | [diff] [blame] | 457 | program_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 458 | scope_stack_test.cc |
dan sinclair | 89caee1 | 2020-12-10 16:56:02 +0000 | [diff] [blame] | 459 | symbol_table_test.cc |
| 460 | symbol_test.cc |
Ben Clayton | 1e29f4b | 2021-01-21 16:20:40 +0000 | [diff] [blame] | 461 | traits_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 462 | type_determiner_test.cc |
Ben Clayton | 207b5e2 | 2021-01-21 15:42:10 +0000 | [diff] [blame] | 463 | type/access_control_type_test.cc |
| 464 | type/alias_type_test.cc |
| 465 | type/array_type_test.cc |
| 466 | type/bool_type_test.cc |
| 467 | type/depth_texture_type_test.cc |
| 468 | type/f32_type_test.cc |
| 469 | type/i32_type_test.cc |
| 470 | type/matrix_type_test.cc |
| 471 | type/multisampled_texture_type_test.cc |
| 472 | type/pointer_type_test.cc |
| 473 | type/sampled_texture_type_test.cc |
| 474 | type/sampler_type_test.cc |
| 475 | type/storage_texture_type_test.cc |
| 476 | type/struct_type_test.cc |
| 477 | type/texture_type_test.cc |
| 478 | type/type_manager_test.cc |
| 479 | type/u32_type_test.cc |
| 480 | type/vector_type_test.cc |
Alan Baker | e809fb3 | 2021-02-01 15:33:13 +0000 | [diff] [blame^] | 481 | validator/validator_builtins_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 482 | validator/validator_control_block_test.cc |
| 483 | validator/validator_function_test.cc |
| 484 | validator/validator_test.cc |
| 485 | validator/validator_type_test.cc |
| 486 | writer/float_to_string_test.cc |
| 487 | ) |
dan sinclair | 4b71b9e | 2020-03-18 14:08:48 +0000 | [diff] [blame] | 488 | |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 489 | if(${TINT_BUILD_SPV_READER}) |
| 490 | list(APPEND TINT_TEST_SRCS |
| 491 | reader/spirv/enum_converter_test.cc |
| 492 | reader/spirv/fail_stream_test.cc |
| 493 | reader/spirv/function_arithmetic_test.cc |
| 494 | reader/spirv/function_bit_test.cc |
| 495 | reader/spirv/function_cfg_test.cc |
| 496 | reader/spirv/function_call_test.cc |
| 497 | reader/spirv/function_composite_test.cc |
| 498 | reader/spirv/function_conversion_test.cc |
| 499 | reader/spirv/function_decl_test.cc |
| 500 | reader/spirv/function_glsl_std_450_test.cc |
| 501 | reader/spirv/function_logical_test.cc |
| 502 | reader/spirv/function_memory_test.cc |
| 503 | reader/spirv/function_misc_test.cc |
| 504 | reader/spirv/function_var_test.cc |
| 505 | reader/spirv/namer_test.cc |
| 506 | reader/spirv/parser_impl_convert_member_decoration_test.cc |
| 507 | reader/spirv/parser_impl_convert_type_test.cc |
| 508 | reader/spirv/parser_impl_function_decl_test.cc |
| 509 | reader/spirv/parser_impl_get_decorations_test.cc |
| 510 | reader/spirv/parser_impl_handle_test.cc |
| 511 | reader/spirv/parser_impl_import_test.cc |
| 512 | reader/spirv/parser_impl_module_var_test.cc |
| 513 | reader/spirv/parser_impl_named_types_test.cc |
| 514 | reader/spirv/parser_impl_test.cc |
| 515 | reader/spirv/parser_impl_user_name_test.cc |
| 516 | reader/spirv/parser_test.cc |
| 517 | reader/spirv/spirv_tools_helpers_test.cc |
| 518 | reader/spirv/spirv_tools_helpers_test.h |
| 519 | reader/spirv/usage_test.cc |
| 520 | ) |
Ben Clayton | 12ed862 | 2020-11-24 15:28:06 +0000 | [diff] [blame] | 521 | endif() |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 522 | |
| 523 | if(${TINT_BUILD_WGSL_READER}) |
| 524 | list(APPEND TINT_TEST_SRCS |
| 525 | reader/wgsl/lexer_test.cc |
| 526 | reader/wgsl/parser_test.cc |
| 527 | reader/wgsl/parser_impl_additive_expression_test.cc |
| 528 | reader/wgsl/parser_impl_and_expression_test.cc |
| 529 | reader/wgsl/parser_impl_argument_expression_list_test.cc |
| 530 | reader/wgsl/parser_impl_assignment_stmt_test.cc |
| 531 | reader/wgsl/parser_impl_body_stmt_test.cc |
| 532 | reader/wgsl/parser_impl_break_stmt_test.cc |
| 533 | reader/wgsl/parser_impl_call_stmt_test.cc |
| 534 | reader/wgsl/parser_impl_case_body_test.cc |
| 535 | reader/wgsl/parser_impl_const_expr_test.cc |
| 536 | reader/wgsl/parser_impl_const_literal_test.cc |
| 537 | reader/wgsl/parser_impl_continue_stmt_test.cc |
| 538 | reader/wgsl/parser_impl_continuing_stmt_test.cc |
| 539 | reader/wgsl/parser_impl_depth_texture_type_test.cc |
| 540 | reader/wgsl/parser_impl_else_stmt_test.cc |
| 541 | reader/wgsl/parser_impl_elseif_stmt_test.cc |
| 542 | reader/wgsl/parser_impl_equality_expression_test.cc |
| 543 | reader/wgsl/parser_impl_error_msg_test.cc |
| 544 | reader/wgsl/parser_impl_error_resync_test.cc |
| 545 | reader/wgsl/parser_impl_exclusive_or_expression_test.cc |
| 546 | reader/wgsl/parser_impl_for_stmt_test.cc |
| 547 | reader/wgsl/parser_impl_function_decl_test.cc |
| 548 | reader/wgsl/parser_impl_function_decoration_list_test.cc |
| 549 | reader/wgsl/parser_impl_function_decoration_test.cc |
| 550 | reader/wgsl/parser_impl_function_header_test.cc |
| 551 | reader/wgsl/parser_impl_function_type_decl_test.cc |
| 552 | reader/wgsl/parser_impl_global_constant_decl_test.cc |
| 553 | reader/wgsl/parser_impl_global_decl_test.cc |
| 554 | reader/wgsl/parser_impl_global_variable_decl_test.cc |
| 555 | reader/wgsl/parser_impl_if_stmt_test.cc |
| 556 | reader/wgsl/parser_impl_image_storage_type_test.cc |
| 557 | reader/wgsl/parser_impl_inclusive_or_expression_test.cc |
| 558 | reader/wgsl/parser_impl_logical_and_expression_test.cc |
| 559 | reader/wgsl/parser_impl_logical_or_expression_test.cc |
| 560 | reader/wgsl/parser_impl_loop_stmt_test.cc |
| 561 | reader/wgsl/parser_impl_multiplicative_expression_test.cc |
| 562 | reader/wgsl/parser_impl_param_list_test.cc |
| 563 | reader/wgsl/parser_impl_paren_rhs_stmt_test.cc |
| 564 | reader/wgsl/parser_impl_pipeline_stage_test.cc |
| 565 | reader/wgsl/parser_impl_postfix_expression_test.cc |
| 566 | reader/wgsl/parser_impl_primary_expression_test.cc |
| 567 | reader/wgsl/parser_impl_relational_expression_test.cc |
| 568 | reader/wgsl/parser_impl_sampled_texture_type_test.cc |
| 569 | reader/wgsl/parser_impl_sampler_type_test.cc |
| 570 | reader/wgsl/parser_impl_shift_expression_test.cc |
| 571 | reader/wgsl/parser_impl_statement_test.cc |
| 572 | reader/wgsl/parser_impl_statements_test.cc |
| 573 | reader/wgsl/parser_impl_storage_class_test.cc |
| 574 | reader/wgsl/parser_impl_storage_texture_type_test.cc |
| 575 | reader/wgsl/parser_impl_struct_body_decl_test.cc |
| 576 | reader/wgsl/parser_impl_struct_decl_test.cc |
| 577 | reader/wgsl/parser_impl_struct_decoration_decl_test.cc |
| 578 | reader/wgsl/parser_impl_struct_decoration_test.cc |
| 579 | reader/wgsl/parser_impl_struct_member_decoration_decl_test.cc |
| 580 | reader/wgsl/parser_impl_struct_member_decoration_test.cc |
| 581 | reader/wgsl/parser_impl_struct_member_test.cc |
| 582 | reader/wgsl/parser_impl_switch_body_test.cc |
| 583 | reader/wgsl/parser_impl_switch_stmt_test.cc |
| 584 | reader/wgsl/parser_impl_test.cc |
| 585 | reader/wgsl/parser_impl_test_helper.cc |
| 586 | reader/wgsl/parser_impl_test_helper.h |
| 587 | reader/wgsl/parser_impl_texture_sampler_types_test.cc |
| 588 | reader/wgsl/parser_impl_type_alias_test.cc |
| 589 | reader/wgsl/parser_impl_type_decl_test.cc |
| 590 | reader/wgsl/parser_impl_unary_expression_test.cc |
| 591 | reader/wgsl/parser_impl_variable_decl_test.cc |
| 592 | reader/wgsl/parser_impl_variable_decoration_list_test.cc |
| 593 | reader/wgsl/parser_impl_variable_decoration_test.cc |
| 594 | reader/wgsl/parser_impl_variable_ident_decl_test.cc |
| 595 | reader/wgsl/parser_impl_variable_stmt_test.cc |
| 596 | reader/wgsl/parser_impl_variable_storage_decoration_test.cc |
| 597 | reader/wgsl/token_test.cc |
| 598 | ) |
| 599 | endif() |
| 600 | |
| 601 | if(${TINT_BUILD_SPV_WRITER}) |
| 602 | list(APPEND TINT_TEST_SRCS |
| 603 | writer/spirv/binary_writer_test.cc |
| 604 | writer/spirv/builder_accessor_expression_test.cc |
| 605 | writer/spirv/builder_assign_test.cc |
| 606 | writer/spirv/builder_binary_expression_test.cc |
| 607 | writer/spirv/builder_bitcast_expression_test.cc |
| 608 | writer/spirv/builder_block_test.cc |
| 609 | writer/spirv/builder_call_test.cc |
| 610 | writer/spirv/builder_constructor_expression_test.cc |
| 611 | writer/spirv/builder_discard_test.cc |
| 612 | writer/spirv/builder_format_conversion_test.cc |
| 613 | writer/spirv/builder_function_decoration_test.cc |
| 614 | writer/spirv/builder_function_test.cc |
| 615 | writer/spirv/builder_function_variable_test.cc |
| 616 | writer/spirv/builder_global_variable_test.cc |
| 617 | writer/spirv/builder_ident_expression_test.cc |
| 618 | writer/spirv/builder_if_test.cc |
| 619 | writer/spirv/builder_intrinsic_test.cc |
| 620 | writer/spirv/builder_intrinsic_texture_test.cc |
| 621 | writer/spirv/builder_literal_test.cc |
| 622 | writer/spirv/builder_loop_test.cc |
| 623 | writer/spirv/builder_return_test.cc |
| 624 | writer/spirv/builder_switch_test.cc |
| 625 | writer/spirv/builder_test.cc |
| 626 | writer/spirv/builder_type_test.cc |
| 627 | writer/spirv/builder_unary_op_expression_test.cc |
| 628 | writer/spirv/instruction_test.cc |
| 629 | writer/spirv/operand_test.cc |
| 630 | writer/spirv/spv_dump.cc |
| 631 | writer/spirv/spv_dump.h |
| 632 | writer/spirv/test_helper.h |
| 633 | ) |
| 634 | endif() |
| 635 | |
| 636 | if(${TINT_BUILD_WGSL_WRITER}) |
| 637 | list(APPEND TINT_TEST_SRCS |
| 638 | writer/wgsl/generator_impl_test.cc |
| 639 | writer/wgsl/generator_impl_alias_type_test.cc |
| 640 | writer/wgsl/generator_impl_array_accessor_test.cc |
| 641 | writer/wgsl/generator_impl_assign_test.cc |
| 642 | writer/wgsl/generator_impl_binary_test.cc |
| 643 | writer/wgsl/generator_impl_bitcast_test.cc |
| 644 | writer/wgsl/generator_impl_block_test.cc |
| 645 | writer/wgsl/generator_impl_break_test.cc |
| 646 | writer/wgsl/generator_impl_call_test.cc |
| 647 | writer/wgsl/generator_impl_case_test.cc |
| 648 | writer/wgsl/generator_impl_cast_test.cc |
| 649 | writer/wgsl/generator_impl_constructor_test.cc |
| 650 | writer/wgsl/generator_impl_continue_test.cc |
| 651 | writer/wgsl/generator_impl_discard_test.cc |
| 652 | writer/wgsl/generator_impl_fallthrough_test.cc |
| 653 | writer/wgsl/generator_impl_function_test.cc |
| 654 | writer/wgsl/generator_impl_identifier_test.cc |
| 655 | writer/wgsl/generator_impl_if_test.cc |
| 656 | writer/wgsl/generator_impl_loop_test.cc |
| 657 | writer/wgsl/generator_impl_member_accessor_test.cc |
| 658 | writer/wgsl/generator_impl_return_test.cc |
| 659 | writer/wgsl/generator_impl_switch_test.cc |
| 660 | writer/wgsl/generator_impl_type_test.cc |
| 661 | writer/wgsl/generator_impl_unary_op_test.cc |
| 662 | writer/wgsl/generator_impl_variable_decl_statement_test.cc |
| 663 | writer/wgsl/generator_impl_variable_test.cc |
| 664 | writer/wgsl/test_helper.h |
| 665 | ) |
| 666 | endif() |
| 667 | |
Ben Clayton | e9d7f7e | 2021-01-06 12:57:41 +0000 | [diff] [blame] | 668 | if(${TINT_BUILD_WGSL_READER} AND ${TINT_BUILD_WGSL_WRITER}) |
| 669 | list(APPEND TINT_TEST_SRCS |
| 670 | transform/bound_array_accessors_test.cc |
| 671 | transform/emit_vertex_point_size_test.cc |
| 672 | transform/first_index_offset_test.cc |
| 673 | transform/test_helper.h |
| 674 | transform/vertex_pulling_test.cc |
| 675 | ) |
| 676 | endif() |
| 677 | |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 678 | if(${TINT_BUILD_MSL_WRITER}) |
| 679 | list(APPEND TINT_TEST_SRCS |
| 680 | writer/msl/generator_impl_alias_type_test.cc |
| 681 | writer/msl/generator_impl_array_accessor_test.cc |
| 682 | writer/msl/generator_impl_assign_test.cc |
| 683 | writer/msl/generator_impl_binary_test.cc |
| 684 | writer/msl/generator_impl_bitcast_test.cc |
| 685 | writer/msl/generator_impl_block_test.cc |
| 686 | writer/msl/generator_impl_break_test.cc |
| 687 | writer/msl/generator_impl_call_test.cc |
| 688 | writer/msl/generator_impl_case_test.cc |
| 689 | writer/msl/generator_impl_cast_test.cc |
| 690 | writer/msl/generator_impl_constructor_test.cc |
| 691 | writer/msl/generator_impl_continue_test.cc |
| 692 | writer/msl/generator_impl_discard_test.cc |
| 693 | writer/msl/generator_impl_function_entry_point_data_test.cc |
| 694 | writer/msl/generator_impl_function_test.cc |
| 695 | writer/msl/generator_impl_identifier_test.cc |
| 696 | writer/msl/generator_impl_if_test.cc |
| 697 | writer/msl/generator_impl_import_test.cc |
| 698 | writer/msl/generator_impl_intrinsic_test.cc |
| 699 | writer/msl/generator_impl_intrinsic_texture_test.cc |
| 700 | writer/msl/generator_impl_loop_test.cc |
| 701 | writer/msl/generator_impl_member_accessor_test.cc |
| 702 | writer/msl/generator_impl_module_constant_test.cc |
| 703 | writer/msl/generator_impl_return_test.cc |
| 704 | writer/msl/generator_impl_switch_test.cc |
| 705 | writer/msl/generator_impl_test.cc |
| 706 | writer/msl/generator_impl_type_test.cc |
| 707 | writer/msl/generator_impl_unary_op_test.cc |
| 708 | writer/msl/generator_impl_variable_decl_statement_test.cc |
dan sinclair | 987376c | 2021-01-12 04:34:53 +0000 | [diff] [blame] | 709 | writer/msl/namer_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 710 | writer/msl/test_helper.h |
| 711 | ) |
| 712 | endif() |
| 713 | |
| 714 | if (${TINT_BUILD_HLSL_WRITER}) |
| 715 | list(APPEND TINT_TEST_SRCS |
| 716 | writer/hlsl/generator_impl_alias_type_test.cc |
| 717 | writer/hlsl/generator_impl_array_accessor_test.cc |
| 718 | writer/hlsl/generator_impl_assign_test.cc |
| 719 | writer/hlsl/generator_impl_binary_test.cc |
| 720 | writer/hlsl/generator_impl_bitcast_test.cc |
| 721 | writer/hlsl/generator_impl_block_test.cc |
| 722 | writer/hlsl/generator_impl_break_test.cc |
| 723 | writer/hlsl/generator_impl_call_test.cc |
| 724 | writer/hlsl/generator_impl_case_test.cc |
| 725 | writer/hlsl/generator_impl_cast_test.cc |
| 726 | writer/hlsl/generator_impl_constructor_test.cc |
| 727 | writer/hlsl/generator_impl_continue_test.cc |
| 728 | writer/hlsl/generator_impl_discard_test.cc |
| 729 | writer/hlsl/generator_impl_function_entry_point_data_test.cc |
| 730 | writer/hlsl/generator_impl_function_test.cc |
| 731 | writer/hlsl/generator_impl_identifier_test.cc |
| 732 | writer/hlsl/generator_impl_if_test.cc |
| 733 | writer/hlsl/generator_impl_intrinsic_test.cc |
| 734 | writer/hlsl/generator_impl_intrinsic_texture_test.cc |
| 735 | writer/hlsl/generator_impl_import_test.cc |
| 736 | writer/hlsl/generator_impl_loop_test.cc |
| 737 | writer/hlsl/generator_impl_member_accessor_test.cc |
| 738 | writer/hlsl/generator_impl_module_constant_test.cc |
| 739 | writer/hlsl/generator_impl_return_test.cc |
| 740 | writer/hlsl/generator_impl_switch_test.cc |
| 741 | writer/hlsl/generator_impl_test.cc |
| 742 | writer/hlsl/generator_impl_type_test.cc |
| 743 | writer/hlsl/generator_impl_unary_op_test.cc |
| 744 | writer/hlsl/generator_impl_variable_decl_statement_test.cc |
dan sinclair | 987376c | 2021-01-12 04:34:53 +0000 | [diff] [blame] | 745 | writer/hlsl/namer_test.cc |
Corentin Wallez | f3717fa | 2020-12-09 14:47:30 +0000 | [diff] [blame] | 746 | writer/hlsl/test_helper.h |
| 747 | ) |
| 748 | endif() |
| 749 | |
| 750 | add_executable(tint_unittests ${TINT_TEST_SRCS}) |
| 751 | |
| 752 | if(NOT MSVC) |
| 753 | target_compile_options(tint_unittests PRIVATE |
| 754 | -Wno-global-constructors |
| 755 | -Wno-weak-vtables |
| 756 | ) |
| 757 | endif() |
| 758 | |
| 759 | ## Test executable |
| 760 | target_include_directories( |
| 761 | tint_unittests PRIVATE ${gmock_SOURCE_DIR}/include) |
| 762 | target_link_libraries(tint_unittests libtint gmock_main) |
| 763 | tint_default_compile_options(tint_unittests) |
| 764 | |
| 765 | if(${TINT_BUILD_SPV_READER} OR ${TINT_BUILD_SPV_WRITER}) |
| 766 | tint_spvtools_compile_options(tint_unittests) |
| 767 | endif() |
| 768 | |
| 769 | add_test(NAME tint_unittests COMMAND tint_unittests) |
Dan Sinclair | 6e58189 | 2020-03-02 15:47:43 -0500 | [diff] [blame] | 770 | endif() |