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