Debian Codegraph @

third_party/spirv-tools/source/opt/CMakeLists.txt

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