CMakeLists.txt 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. # Copyright (c) 2016 Google Inc.
  2. # Licensed under the Apache License, Version 2.0 (the "License");
  3. # you may not use this file except in compliance with the License.
  4. # You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software
  9. # distributed under the License is distributed on an "AS IS" BASIS,
  10. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. # See the License for the specific language governing permissions and
  12. # limitations under the License.
  13. set(SPIRV_TOOLS_OPT_SOURCES
  14. fix_func_call_arguments.h
  15. aggressive_dead_code_elim_pass.h
  16. amd_ext_to_khr.h
  17. analyze_live_input_pass.h
  18. basic_block.h
  19. block_merge_pass.h
  20. block_merge_util.h
  21. build_module.h
  22. ccp_pass.h
  23. cfg_cleanup_pass.h
  24. cfg.h
  25. code_sink.h
  26. combine_access_chains.h
  27. compact_ids_pass.h
  28. composite.h
  29. const_folding_rules.h
  30. constants.h
  31. control_dependence.h
  32. convert_to_sampled_image_pass.h
  33. convert_to_half_pass.h
  34. copy_prop_arrays.h
  35. dataflow.h
  36. dead_branch_elim_pass.h
  37. dead_insert_elim_pass.h
  38. dead_variable_elimination.h
  39. decoration_manager.h
  40. debug_info_manager.h
  41. def_use_manager.h
  42. desc_sroa.h
  43. desc_sroa_util.h
  44. dominator_analysis.h
  45. dominator_tree.h
  46. eliminate_dead_constant_pass.h
  47. eliminate_dead_functions_pass.h
  48. eliminate_dead_functions_util.h
  49. eliminate_dead_io_components_pass.h
  50. eliminate_dead_members_pass.h
  51. eliminate_dead_output_stores_pass.h
  52. empty_pass.h
  53. feature_manager.h
  54. fix_storage_class.h
  55. flatten_decoration_pass.h
  56. fold.h
  57. folding_rules.h
  58. fold_spec_constant_op_and_composite_pass.h
  59. freeze_spec_constant_value_pass.h
  60. function.h
  61. graphics_robust_access_pass.h
  62. if_conversion.h
  63. inline_exhaustive_pass.h
  64. inline_opaque_pass.h
  65. inline_pass.h
  66. instruction.h
  67. instruction_list.h
  68. interface_var_sroa.h
  69. invocation_interlock_placement_pass.h
  70. interp_fixup_pass.h
  71. opextinst_forward_ref_fixup_pass.h
  72. ir_builder.h
  73. ir_context.h
  74. ir_loader.h
  75. licm_pass.h
  76. liveness.h
  77. local_access_chain_convert_pass.h
  78. local_redundancy_elimination.h
  79. local_single_block_elim_pass.h
  80. local_single_store_elim_pass.h
  81. log.h
  82. loop_dependence.h
  83. loop_descriptor.h
  84. loop_fission.h
  85. loop_fusion.h
  86. loop_fusion_pass.h
  87. loop_peeling.h
  88. loop_unroller.h
  89. loop_utils.h
  90. loop_unswitch_pass.h
  91. mem_pass.h
  92. merge_return_pass.h
  93. modify_maximal_reconvergence.h
  94. module.h
  95. null_pass.h
  96. passes.h
  97. pass.h
  98. pass_manager.h
  99. private_to_local_pass.h
  100. propagator.h
  101. reduce_load_size.h
  102. redundancy_elimination.h
  103. reflect.h
  104. register_pressure.h
  105. relax_float_ops_pass.h
  106. remove_dontinline_pass.h
  107. remove_duplicates_pass.h
  108. remove_unused_interface_variables_pass.h
  109. replace_desc_array_access_using_var_index.h
  110. replace_invalid_opc.h
  111. resolve_binding_conflicts_pass.h
  112. scalar_analysis.h
  113. scalar_analysis_nodes.h
  114. scalar_replacement_pass.h
  115. set_spec_constant_default_value_pass.h
  116. simplification_pass.h
  117. split_combined_image_sampler_pass.h
  118. spread_volatile_semantics.h
  119. ssa_rewrite_pass.h
  120. strength_reduction_pass.h
  121. strip_debug_info_pass.h
  122. strip_nonsemantic_info_pass.h
  123. struct_cfg_analysis.h
  124. switch_descriptorset_pass.h
  125. tree_iterator.h
  126. trim_capabilities_pass.h
  127. type_manager.h
  128. types.h
  129. unify_const_pass.h
  130. upgrade_memory_model.h
  131. value_number_table.h
  132. vector_dce.h
  133. workaround1209.h
  134. wrap_opkill.h
  135. fix_func_call_arguments.cpp
  136. aggressive_dead_code_elim_pass.cpp
  137. amd_ext_to_khr.cpp
  138. analyze_live_input_pass.cpp
  139. basic_block.cpp
  140. block_merge_pass.cpp
  141. block_merge_util.cpp
  142. build_module.cpp
  143. ccp_pass.cpp
  144. cfg_cleanup_pass.cpp
  145. cfg.cpp
  146. code_sink.cpp
  147. combine_access_chains.cpp
  148. compact_ids_pass.cpp
  149. composite.cpp
  150. const_folding_rules.cpp
  151. constants.cpp
  152. control_dependence.cpp
  153. convert_to_sampled_image_pass.cpp
  154. convert_to_half_pass.cpp
  155. copy_prop_arrays.cpp
  156. dataflow.cpp
  157. dead_branch_elim_pass.cpp
  158. dead_insert_elim_pass.cpp
  159. dead_variable_elimination.cpp
  160. decoration_manager.cpp
  161. debug_info_manager.cpp
  162. def_use_manager.cpp
  163. desc_sroa.cpp
  164. desc_sroa_util.cpp
  165. dominator_analysis.cpp
  166. dominator_tree.cpp
  167. eliminate_dead_constant_pass.cpp
  168. eliminate_dead_functions_pass.cpp
  169. eliminate_dead_functions_util.cpp
  170. eliminate_dead_io_components_pass.cpp
  171. eliminate_dead_members_pass.cpp
  172. eliminate_dead_output_stores_pass.cpp
  173. feature_manager.cpp
  174. fix_storage_class.cpp
  175. flatten_decoration_pass.cpp
  176. fold.cpp
  177. folding_rules.cpp
  178. fold_spec_constant_op_and_composite_pass.cpp
  179. freeze_spec_constant_value_pass.cpp
  180. function.cpp
  181. graphics_robust_access_pass.cpp
  182. if_conversion.cpp
  183. inline_exhaustive_pass.cpp
  184. inline_opaque_pass.cpp
  185. inline_pass.cpp
  186. instruction.cpp
  187. instruction_list.cpp
  188. interface_var_sroa.cpp
  189. invocation_interlock_placement_pass.cpp
  190. interp_fixup_pass.cpp
  191. opextinst_forward_ref_fixup_pass.cpp
  192. ir_context.cpp
  193. ir_loader.cpp
  194. licm_pass.cpp
  195. liveness.cpp
  196. local_access_chain_convert_pass.cpp
  197. local_redundancy_elimination.cpp
  198. local_single_block_elim_pass.cpp
  199. local_single_store_elim_pass.cpp
  200. loop_dependence.cpp
  201. loop_dependence_helpers.cpp
  202. loop_descriptor.cpp
  203. loop_fission.cpp
  204. loop_fusion.cpp
  205. loop_fusion_pass.cpp
  206. loop_peeling.cpp
  207. loop_utils.cpp
  208. loop_unroller.cpp
  209. loop_unswitch_pass.cpp
  210. mem_pass.cpp
  211. merge_return_pass.cpp
  212. modify_maximal_reconvergence.cpp
  213. module.cpp
  214. optimizer.cpp
  215. pass.cpp
  216. pass_manager.cpp
  217. private_to_local_pass.cpp
  218. propagator.cpp
  219. reduce_load_size.cpp
  220. redundancy_elimination.cpp
  221. register_pressure.cpp
  222. relax_float_ops_pass.cpp
  223. remove_dontinline_pass.cpp
  224. remove_duplicates_pass.cpp
  225. remove_unused_interface_variables_pass.cpp
  226. replace_desc_array_access_using_var_index.cpp
  227. replace_invalid_opc.cpp
  228. resolve_binding_conflicts_pass.cpp
  229. scalar_analysis.cpp
  230. scalar_analysis_simplification.cpp
  231. scalar_replacement_pass.cpp
  232. set_spec_constant_default_value_pass.cpp
  233. simplification_pass.cpp
  234. split_combined_image_sampler_pass.cpp
  235. spread_volatile_semantics.cpp
  236. ssa_rewrite_pass.cpp
  237. strength_reduction_pass.cpp
  238. strip_debug_info_pass.cpp
  239. strip_nonsemantic_info_pass.cpp
  240. struct_cfg_analysis.cpp
  241. struct_packing_pass.cpp
  242. switch_descriptorset_pass.cpp
  243. trim_capabilities_pass.cpp
  244. type_manager.cpp
  245. types.cpp
  246. unify_const_pass.cpp
  247. upgrade_memory_model.cpp
  248. value_number_table.cpp
  249. vector_dce.cpp
  250. workaround1209.cpp
  251. wrap_opkill.cpp
  252. )
  253. if(MSVC AND (NOT ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")))
  254. # Enable parallel builds across four cores for this lib
  255. add_definitions(/MP4)
  256. endif()
  257. spvtools_pch(SPIRV_TOOLS_OPT_SOURCES pch_source_opt)
  258. add_library(SPIRV-Tools-opt ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_TOOLS_OPT_SOURCES})
  259. spvtools_default_compile_options(SPIRV-Tools-opt)
  260. target_include_directories(SPIRV-Tools-opt
  261. PUBLIC
  262. $<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
  263. $<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
  264. $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  265. PRIVATE ${spirv-tools_BINARY_DIR}
  266. )
  267. # We need the assembling and disassembling functionalities in the main library.
  268. target_link_libraries(SPIRV-Tools-opt
  269. PUBLIC ${SPIRV_TOOLS_FULL_VISIBILITY})
  270. set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries")
  271. spvtools_check_symbol_exports(SPIRV-Tools-opt)
  272. if(ENABLE_SPIRV_TOOLS_INSTALL)
  273. install(TARGETS SPIRV-Tools-opt EXPORT SPIRV-Tools-optTargets)
  274. export(EXPORT SPIRV-Tools-optTargets FILE SPIRV-Tools-optTargets.cmake)
  275. spvtools_config_package_dir(SPIRV-Tools-opt PACKAGE_DIR)
  276. install(EXPORT SPIRV-Tools-optTargets FILE SPIRV-Tools-optTargets.cmake
  277. DESTINATION ${PACKAGE_DIR})
  278. spvtools_generate_config_file(SPIRV-Tools-opt)
  279. install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-optConfig.cmake DESTINATION ${PACKAGE_DIR})
  280. endif(ENABLE_SPIRV_TOOLS_INSTALL)