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. 14 set(SPIRV_TOOLS_OPT_SOURCES 15 aggressive_dead_code_elim_pass.h 16 basic_block.h 17 block_merge_pass.h 18 build_module.h 19 ccp_pass.h 20 cfg_cleanup_pass.h 21 cfg.h 22 code_sink.h 23 combine_access_chains.h 24 common_uniform_elim_pass.h 25 compact_ids_pass.h 26 composite.h 27 const_folding_rules.h 28 constants.h 29 copy_prop_arrays.h 30 dead_branch_elim_pass.h 31 dead_insert_elim_pass.h 32 dead_variable_elimination.h 33 decoration_manager.h 34 def_use_manager.h 35 dominator_analysis.h 36 dominator_tree.h 37 eliminate_dead_constant_pass.h 38 eliminate_dead_functions_pass.h 39 feature_manager.h 40 flatten_decoration_pass.h 41 fold.h 42 folding_rules.h 43 fold_spec_constant_op_and_composite_pass.h 44 freeze_spec_constant_value_pass.h 45 function.h 46 if_conversion.h 47 inline_exhaustive_pass.h 48 inline_opaque_pass.h 49 inline_pass.h 50 inst_bindless_check_pass.h 51 instruction.h 52 instruction_list.h 53 instrument_pass.h 54 ir_builder.h 55 ir_context.h 56 ir_loader.h 57 licm_pass.h 58 local_access_chain_convert_pass.h 59 local_redundancy_elimination.h 60 local_single_block_elim_pass.h 61 local_single_store_elim_pass.h 62 local_ssa_elim_pass.h 63 log.h 64 loop_dependence.h 65 loop_descriptor.h 66 loop_fission.h 67 loop_fusion.h 68 loop_fusion_pass.h 69 loop_peeling.h 70 loop_unroller.h 71 loop_utils.h 72 loop_unswitch_pass.h 73 mem_pass.h 74 merge_return_pass.h 75 module.h 76 null_pass.h 77 passes.h 78 pass.h 79 pass_manager.h 80 private_to_local_pass.h 81 process_lines_pass.h 82 propagator.h 83 reduce_load_size.h 84 redundancy_elimination.h 85 reflect.h 86 register_pressure.h 87 remove_duplicates_pass.h 88 replace_invalid_opc.h 89 scalar_analysis.h 90 scalar_analysis_nodes.h 91 scalar_replacement_pass.h 92 set_spec_constant_default_value_pass.h 93 simplification_pass.h 94 ssa_rewrite_pass.h 95 strength_reduction_pass.h 96 strip_debug_info_pass.h 97 strip_reflect_info_pass.h 98 struct_cfg_analysis.h 99 tree_iterator.h 100 type_manager.h 101 types.h 102 unify_const_pass.h 103 upgrade_memory_model.h 104 value_number_table.h 105 vector_dce.h 106 workaround1209.h 107 108 aggressive_dead_code_elim_pass.cpp 109 basic_block.cpp 110 block_merge_pass.cpp 111 build_module.cpp 112 ccp_pass.cpp 113 cfg_cleanup_pass.cpp 114 cfg.cpp 115 code_sink.cpp 116 combine_access_chains.cpp 117 common_uniform_elim_pass.cpp 118 compact_ids_pass.cpp 119 composite.cpp 120 const_folding_rules.cpp 121 constants.cpp 122 copy_prop_arrays.cpp 123 dead_branch_elim_pass.cpp 124 dead_insert_elim_pass.cpp 125 dead_variable_elimination.cpp 126 decoration_manager.cpp 127 def_use_manager.cpp 128 dominator_analysis.cpp 129 dominator_tree.cpp 130 eliminate_dead_constant_pass.cpp 131 eliminate_dead_functions_pass.cpp 132 feature_manager.cpp 133 flatten_decoration_pass.cpp 134 fold.cpp 135 folding_rules.cpp 136 fold_spec_constant_op_and_composite_pass.cpp 137 freeze_spec_constant_value_pass.cpp 138 function.cpp 139 if_conversion.cpp 140 inline_exhaustive_pass.cpp 141 inline_opaque_pass.cpp 142 inline_pass.cpp 143 inst_bindless_check_pass.cpp 144 instruction.cpp 145 instruction_list.cpp 146 instrument_pass.cpp 147 ir_context.cpp 148 ir_loader.cpp 149 licm_pass.cpp 150 local_access_chain_convert_pass.cpp 151 local_redundancy_elimination.cpp 152 local_single_block_elim_pass.cpp 153 local_single_store_elim_pass.cpp 154 local_ssa_elim_pass.cpp 155 loop_dependence.cpp 156 loop_dependence_helpers.cpp 157 loop_descriptor.cpp 158 loop_fission.cpp 159 loop_fusion.cpp 160 loop_fusion_pass.cpp 161 loop_peeling.cpp 162 loop_utils.cpp 163 loop_unroller.cpp 164 loop_unswitch_pass.cpp 165 mem_pass.cpp 166 merge_return_pass.cpp 167 module.cpp 168 optimizer.cpp 169 pass.cpp 170 pass_manager.cpp 171 private_to_local_pass.cpp 172 process_lines_pass.cpp 173 propagator.cpp 174 reduce_load_size.cpp 175 redundancy_elimination.cpp 176 register_pressure.cpp 177 remove_duplicates_pass.cpp 178 replace_invalid_opc.cpp 179 scalar_analysis.cpp 180 scalar_analysis_simplification.cpp 181 scalar_replacement_pass.cpp 182 set_spec_constant_default_value_pass.cpp 183 simplification_pass.cpp 184 ssa_rewrite_pass.cpp 185 strength_reduction_pass.cpp 186 strip_debug_info_pass.cpp 187 strip_reflect_info_pass.cpp 188 struct_cfg_analysis.cpp 189 type_manager.cpp 190 types.cpp 191 unify_const_pass.cpp 192 upgrade_memory_model.cpp 193 value_number_table.cpp 194 vector_dce.cpp 195 workaround1209.cpp 196 ) 197 198 if(MSVC) 199 # Enable parallel builds across four cores for this lib 200 add_definitions(/MP4) 201 endif() 202 203 spvtools_pch(SPIRV_TOOLS_OPT_SOURCES pch_source_opt) 204 205 add_library(SPIRV-Tools-opt ${SPIRV_TOOLS_OPT_SOURCES}) 206 207 spvtools_default_compile_options(SPIRV-Tools-opt) 208 target_include_directories(SPIRV-Tools-opt 209 PUBLIC ${spirv-tools_SOURCE_DIR}/include 210 PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} 211 PRIVATE ${spirv-tools_BINARY_DIR} 212 ) 213 # We need the assembling and disassembling functionalities in the main library. 214 target_link_libraries(SPIRV-Tools-opt 215 PUBLIC ${SPIRV_TOOLS}) 216 217 set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries") 218 spvtools_check_symbol_exports(SPIRV-Tools-opt) 219 220 if(ENABLE_SPIRV_TOOLS_INSTALL) 221 install(TARGETS SPIRV-Tools-opt 222 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 223 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 224 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 225 endif(ENABLE_SPIRV_TOOLS_INSTALL) 226