• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  module.h
98  null_pass.h
99  passes.h
100  pass.h
101  pass_manager.h
102  private_to_local_pass.h
103  propagator.h
104  reduce_load_size.h
105  redundancy_elimination.h
106  reflect.h
107  register_pressure.h
108  relax_float_ops_pass.h
109  remove_dontinline_pass.h
110  remove_duplicates_pass.h
111  remove_unused_interface_variables_pass.h
112  replace_desc_array_access_using_var_index.h
113  replace_invalid_opc.h
114  scalar_analysis.h
115  scalar_analysis_nodes.h
116  scalar_replacement_pass.h
117  set_spec_constant_default_value_pass.h
118  simplification_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  inst_bindless_check_pass.cpp
189  inst_buff_addr_check_pass.cpp
190  inst_debug_printf_pass.cpp
191  instruction.cpp
192  instruction_list.cpp
193  instrument_pass.cpp
194  interface_var_sroa.cpp
195  invocation_interlock_placement_pass.cpp
196  interp_fixup_pass.cpp
197  ir_context.cpp
198  ir_loader.cpp
199  licm_pass.cpp
200  liveness.cpp
201  local_access_chain_convert_pass.cpp
202  local_redundancy_elimination.cpp
203  local_single_block_elim_pass.cpp
204  local_single_store_elim_pass.cpp
205  loop_dependence.cpp
206  loop_dependence_helpers.cpp
207  loop_descriptor.cpp
208  loop_fission.cpp
209  loop_fusion.cpp
210  loop_fusion_pass.cpp
211  loop_peeling.cpp
212  loop_utils.cpp
213  loop_unroller.cpp
214  loop_unswitch_pass.cpp
215  mem_pass.cpp
216  merge_return_pass.cpp
217  module.cpp
218  optimizer.cpp
219  pass.cpp
220  pass_manager.cpp
221  private_to_local_pass.cpp
222  propagator.cpp
223  reduce_load_size.cpp
224  redundancy_elimination.cpp
225  register_pressure.cpp
226  relax_float_ops_pass.cpp
227  remove_dontinline_pass.cpp
228  remove_duplicates_pass.cpp
229  remove_unused_interface_variables_pass.cpp
230  replace_desc_array_access_using_var_index.cpp
231  replace_invalid_opc.cpp
232  scalar_analysis.cpp
233  scalar_analysis_simplification.cpp
234  scalar_replacement_pass.cpp
235  set_spec_constant_default_value_pass.cpp
236  simplification_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  switch_descriptorset_pass.cpp
244  trim_capabilities_pass.cpp
245  type_manager.cpp
246  types.cpp
247  unify_const_pass.cpp
248  upgrade_memory_model.cpp
249  value_number_table.cpp
250  vector_dce.cpp
251  workaround1209.cpp
252  wrap_opkill.cpp
253)
254
255if(MSVC AND (NOT ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")))
256  # Enable parallel builds across four cores for this lib
257  add_definitions(/MP4)
258endif()
259
260spvtools_pch(SPIRV_TOOLS_OPT_SOURCES pch_source_opt)
261
262add_library(SPIRV-Tools-opt ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_TOOLS_OPT_SOURCES})
263
264spvtools_default_compile_options(SPIRV-Tools-opt)
265target_include_directories(SPIRV-Tools-opt
266  PUBLIC
267	$<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
268	$<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
269	$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
270  PRIVATE ${spirv-tools_BINARY_DIR}
271)
272# We need the assembling and disassembling functionalities in the main library.
273target_link_libraries(SPIRV-Tools-opt
274  PUBLIC ${SPIRV_TOOLS_FULL_VISIBILITY})
275
276set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries")
277spvtools_check_symbol_exports(SPIRV-Tools-opt)
278
279if(ENABLE_SPIRV_TOOLS_INSTALL)
280  install(TARGETS SPIRV-Tools-opt EXPORT SPIRV-Tools-optTargets)
281  export(EXPORT SPIRV-Tools-optTargets FILE SPIRV-Tools-optTargets.cmake)
282
283  spvtools_config_package_dir(SPIRV-Tools-opt PACKAGE_DIR)
284  install(EXPORT SPIRV-Tools-optTargets FILE SPIRV-Tools-optTargets.cmake
285  	DESTINATION ${PACKAGE_DIR})
286
287  spvtools_generate_config_file(SPIRV-Tools-opt)
288  install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-optConfig.cmake DESTINATION ${PACKAGE_DIR})
289endif(ENABLE_SPIRV_TOOLS_INSTALL)
290