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