Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

meson.build 9.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. # Copyright © 2017 Intel Corporation
  2. # Permission is hereby granted, free of charge, to any person obtaining a copy
  3. # of this software and associated documentation files (the "Software"), to deal
  4. # in the Software without restriction, including without limitation the rights
  5. # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  6. # copies of the Software, and to permit persons to whom the Software is
  7. # furnished to do so, subject to the following conditions:
  8. # The above copyright notice and this permission notice shall be included in
  9. # all copies or substantial portions of the Software.
  10. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11. # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12. # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13. # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  14. # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  15. # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  16. # SOFTWARE.
  17. nir_depends = files('nir_opcodes.py', 'nir_intrinsics.py')
  18. nir_builder_opcodes_h = custom_target(
  19. 'nir_builder_opcodes.h',
  20. input : 'nir_builder_opcodes_h.py',
  21. output : 'nir_builder_opcodes.h',
  22. command : [prog_python, '@INPUT@'],
  23. capture : true,
  24. depend_files : nir_depends,
  25. )
  26. nir_constant_expressions_c = custom_target(
  27. 'nir_constant_expressions.c',
  28. input : 'nir_constant_expressions.py',
  29. output : 'nir_constant_expressions.c',
  30. command : [prog_python, '@INPUT@'],
  31. capture : true,
  32. depend_files : nir_depends,
  33. )
  34. nir_opcodes_h = custom_target(
  35. 'nir_opcodes.h',
  36. input : 'nir_opcodes_h.py',
  37. output : 'nir_opcodes.h',
  38. command : [prog_python, '@INPUT@'],
  39. capture : true,
  40. depend_files : nir_depends,
  41. )
  42. nir_opcodes_c = custom_target(
  43. 'nir_opcodes.c',
  44. input : 'nir_opcodes_c.py',
  45. output : 'nir_opcodes.c',
  46. command : [prog_python, '@INPUT@'],
  47. capture : true,
  48. depend_files : nir_depends,
  49. )
  50. nir_opt_algebraic_c = custom_target(
  51. 'nir_opt_algebraic.c',
  52. input : 'nir_opt_algebraic.py',
  53. output : 'nir_opt_algebraic.c',
  54. command : [prog_python, '@INPUT@'],
  55. capture : true,
  56. depend_files : files('nir_algebraic.py'),
  57. )
  58. nir_intrinsics_h = custom_target(
  59. 'nir_intrinsics.h',
  60. input : 'nir_intrinsics_h.py',
  61. output : 'nir_intrinsics.h',
  62. command : [prog_python, '@INPUT@', '--outdir', meson.current_build_dir()],
  63. capture : false,
  64. depend_files : files('nir_intrinsics.py'),
  65. )
  66. nir_intrinsics_c = custom_target(
  67. 'nir_intrinsic.c',
  68. input : 'nir_intrinsics_c.py',
  69. output : 'nir_intrinsics.c',
  70. command : [prog_python, '@INPUT@', '--outdir', meson.current_build_dir()],
  71. capture: false,
  72. depend_files : files('nir_intrinsics.py'),
  73. )
  74. files_libnir = files(
  75. 'nir.c',
  76. 'nir.h',
  77. 'nir_builder.h',
  78. 'nir_builtin_builder.c',
  79. 'nir_builtin_builder.h',
  80. 'nir_clone.c',
  81. 'nir_constant_expressions.h',
  82. 'nir_control_flow.c',
  83. 'nir_control_flow.h',
  84. 'nir_control_flow_private.h',
  85. 'nir_deref.c',
  86. 'nir_deref.h',
  87. 'nir_divergence_analysis.c',
  88. 'nir_dominance.c',
  89. 'nir_format_convert.h',
  90. 'nir_from_ssa.c',
  91. 'nir_gather_info.c',
  92. 'nir_gather_ssa_types.c',
  93. 'nir_gather_xfb_info.c',
  94. 'nir_gs_count_vertices.c',
  95. 'nir_inline_functions.c',
  96. 'nir_instr_set.c',
  97. 'nir_instr_set.h',
  98. 'nir_linking_helpers.c',
  99. 'nir_liveness.c',
  100. 'nir_loop_analyze.c',
  101. 'nir_loop_analyze.h',
  102. 'nir_lower_alu.c',
  103. 'nir_lower_alu_to_scalar.c',
  104. 'nir_lower_alpha_test.c',
  105. 'nir_lower_amul.c',
  106. 'nir_lower_array_deref_of_vec.c',
  107. 'nir_lower_atomics_to_ssbo.c',
  108. 'nir_lower_bitmap.c',
  109. 'nir_lower_bool_to_float.c',
  110. 'nir_lower_bool_to_int32.c',
  111. 'nir_lower_clamp_color_outputs.c',
  112. 'nir_lower_clip.c',
  113. 'nir_lower_clip_cull_distance_arrays.c',
  114. 'nir_lower_constant_initializers.c',
  115. 'nir_lower_double_ops.c',
  116. 'nir_lower_drawpixels.c',
  117. 'nir_lower_fb_read.c',
  118. 'nir_lower_flatshade.c',
  119. 'nir_lower_flrp.c',
  120. 'nir_lower_fragcoord_wtrans.c',
  121. 'nir_lower_frexp.c',
  122. 'nir_lower_global_vars_to_local.c',
  123. 'nir_lower_gs_intrinsics.c',
  124. 'nir_lower_load_const_to_scalar.c',
  125. 'nir_lower_locals_to_regs.c',
  126. 'nir_lower_idiv.c',
  127. 'nir_lower_indirect_derefs.c',
  128. 'nir_lower_input_attachments.c',
  129. 'nir_lower_int64.c',
  130. 'nir_lower_interpolation.c',
  131. 'nir_lower_int_to_float.c',
  132. 'nir_lower_io.c',
  133. 'nir_lower_io_arrays_to_elements.c',
  134. 'nir_lower_io_to_temporaries.c',
  135. 'nir_lower_io_to_scalar.c',
  136. 'nir_lower_io_to_vector.c',
  137. 'nir_lower_non_uniform_access.c',
  138. 'nir_lower_packing.c',
  139. 'nir_lower_passthrough_edgeflags.c',
  140. 'nir_lower_patch_vertices.c',
  141. 'nir_lower_phis_to_scalar.c',
  142. 'nir_lower_point_size.c',
  143. 'nir_lower_point_size_mov.c',
  144. 'nir_lower_regs_to_ssa.c',
  145. 'nir_lower_returns.c',
  146. 'nir_lower_samplers.c',
  147. 'nir_lower_scratch.c',
  148. 'nir_lower_subgroups.c',
  149. 'nir_lower_system_values.c',
  150. 'nir_lower_tex.c',
  151. 'nir_lower_to_source_mods.c',
  152. 'nir_lower_two_sided_color.c',
  153. 'nir_lower_vars_to_ssa.c',
  154. 'nir_lower_var_copies.c',
  155. 'nir_lower_vec_to_movs.c',
  156. 'nir_lower_viewport_transform.c',
  157. 'nir_lower_wpos_center.c',
  158. 'nir_lower_wpos_ytransform.c',
  159. 'nir_lower_bit_size.c',
  160. 'nir_lower_uniforms_to_ubo.c',
  161. 'nir_metadata.c',
  162. 'nir_move_vec_src_uses_to_dest.c',
  163. 'nir_normalize_cubemap_coords.c',
  164. 'nir_opt_access.c',
  165. 'nir_opt_combine_stores.c',
  166. 'nir_opt_comparison_pre.c',
  167. 'nir_opt_conditional_discard.c',
  168. 'nir_opt_constant_folding.c',
  169. 'nir_opt_copy_prop_vars.c',
  170. 'nir_opt_copy_propagate.c',
  171. 'nir_opt_cse.c',
  172. 'nir_opt_dce.c',
  173. 'nir_opt_dead_cf.c',
  174. 'nir_opt_dead_write_vars.c',
  175. 'nir_opt_find_array_copies.c',
  176. 'nir_opt_gcm.c',
  177. 'nir_opt_idiv_const.c',
  178. 'nir_opt_if.c',
  179. 'nir_opt_intrinsics.c',
  180. 'nir_opt_large_constants.c',
  181. 'nir_opt_load_store_vectorize.c',
  182. 'nir_opt_loop_unroll.c',
  183. 'nir_opt_move.c',
  184. 'nir_opt_peephole_select.c',
  185. 'nir_opt_rematerialize_compares.c',
  186. 'nir_opt_remove_phis.c',
  187. 'nir_opt_shrink_load.c',
  188. 'nir_opt_sink.c',
  189. 'nir_opt_trivial_continues.c',
  190. 'nir_opt_undef.c',
  191. 'nir_opt_vectorize.c',
  192. 'nir_phi_builder.c',
  193. 'nir_phi_builder.h',
  194. 'nir_print.c',
  195. 'nir_propagate_invariant.c',
  196. 'nir_range_analysis.c',
  197. 'nir_range_analysis.h',
  198. 'nir_remove_dead_variables.c',
  199. 'nir_repair_ssa.c',
  200. 'nir_search.c',
  201. 'nir_search.h',
  202. 'nir_search_helpers.h',
  203. 'nir_serialize.c',
  204. 'nir_serialize.h',
  205. 'nir_split_per_member_structs.c',
  206. 'nir_split_var_copies.c',
  207. 'nir_split_vars.c',
  208. 'nir_sweep.c',
  209. 'nir_to_lcssa.c',
  210. 'nir_validate.c',
  211. 'nir_vla.h',
  212. 'nir_worklist.c',
  213. 'nir_worklist.h',
  214. 'nir_xfb_info.h',
  215. '../spirv/GLSL.ext.AMD.h',
  216. '../spirv/GLSL.std.450.h',
  217. '../spirv/gl_spirv.c',
  218. '../spirv/nir_spirv.h',
  219. '../spirv/OpenCL.std.h',
  220. '../spirv/spirv.h',
  221. '../spirv/spirv_info.h',
  222. '../spirv/spirv_to_nir.c',
  223. '../spirv/vtn_alu.c',
  224. '../spirv/vtn_amd.c',
  225. '../spirv/vtn_cfg.c',
  226. '../spirv/vtn_glsl450.c',
  227. '../spirv/vtn_opencl.c',
  228. '../spirv/vtn_private.h',
  229. '../spirv/vtn_subgroup.c',
  230. '../spirv/vtn_variables.c',
  231. )
  232. _libnir = static_library(
  233. 'nir',
  234. [files_libnir, spirv_info_c, nir_opt_algebraic_c, nir_opcodes_c,
  235. nir_opcodes_h, nir_constant_expressions_c, nir_builder_opcodes_h,
  236. vtn_gather_types_c, nir_intrinsics_c, nir_intrinsics_h],
  237. include_directories : [inc_common, inc_compiler, include_directories('../spirv')],
  238. c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
  239. link_with : libcompiler,
  240. build_by_default : false,
  241. )
  242. # Headers-only dependency
  243. idep_nir_headers = declare_dependency(
  244. sources : [nir_opcodes_h, nir_builder_opcodes_h, nir_intrinsics_h],
  245. include_directories : include_directories('.'),
  246. )
  247. # Also link with nir
  248. idep_nir = declare_dependency(
  249. dependencies : idep_nir_headers,
  250. link_with : _libnir,
  251. )
  252. nir_algebraic_py = files('nir_algebraic.py')
  253. if with_tests
  254. test(
  255. 'nir_builder',
  256. executable(
  257. 'nir_builder_test',
  258. files('tests/builder_tests.cpp'),
  259. cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
  260. include_directories : [inc_common],
  261. dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
  262. ),
  263. suite : ['compiler', 'nir'],
  264. )
  265. test(
  266. 'nir_control_flow',
  267. executable(
  268. 'nir_control_flow_test',
  269. files('tests/control_flow_tests.cpp'),
  270. cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
  271. include_directories : [inc_common],
  272. dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
  273. ),
  274. suite : ['compiler', 'nir'],
  275. )
  276. test(
  277. 'nir_vars',
  278. executable(
  279. 'nir_vars_test',
  280. files('tests/vars_tests.cpp'),
  281. cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
  282. include_directories : [inc_common],
  283. dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
  284. ),
  285. suite : ['compiler', 'nir'],
  286. )
  287. test(
  288. 'nir_algebraic_parser',
  289. prog_python,
  290. args : [
  291. join_paths(meson.current_source_dir(), 'tests/algebraic_parser_test.py')
  292. ],
  293. suite : ['compiler', 'nir'],
  294. )
  295. test(
  296. 'negative_equal',
  297. executable(
  298. 'negative_equal',
  299. files('tests/negative_equal_tests.cpp'),
  300. c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
  301. include_directories : [inc_common],
  302. dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
  303. ),
  304. suite : ['compiler', 'nir'],
  305. )
  306. test(
  307. 'comparison_pre',
  308. executable(
  309. 'comparison_pre',
  310. files('tests/comparison_pre_tests.cpp'),
  311. c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
  312. include_directories : [inc_common],
  313. dependencies : [dep_thread, idep_gtest, idep_nir, idep_mesautil],
  314. ),
  315. suite : ['compiler', 'nir'],
  316. )
  317. endif