1 # Copyright (c) 2016 Google Inc.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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 add_library(SPIRV-Tools-opt
15 aggressive_dead_code_elim_pass.h
22 common_uniform_elim_pass.h
26 dead_branch_elim_pass.h
27 dead_insert_elim_pass.h
28 dead_variable_elimination.h
33 eliminate_dead_constant_pass.h
34 eliminate_dead_functions_pass.h
36 flatten_decoration_pass.h
39 fold_spec_constant_op_and_composite_pass.h
40 freeze_spec_constant_value_pass.h
43 inline_exhaustive_pass.h
51 local_access_chain_convert_pass.h
52 local_redundancy_elimination.h
53 local_single_block_elim_pass.h
54 local_single_store_elim_pass.h
66 private_to_local_pass.h
68 redundancy_elimination.h
70 remove_duplicates_pass.h
72 scalar_replacement_pass.h
73 set_spec_constant_default_value_pass.h
75 strength_reduction_pass.h
76 strip_debug_info_pass.h
84 aggressive_dead_code_elim_pass.cpp
91 common_uniform_elim_pass.cpp
95 dead_branch_elim_pass.cpp
96 dead_insert_elim_pass.cpp
97 dead_variable_elimination.cpp
98 decoration_manager.cpp
100 dominator_analysis.cpp
102 eliminate_dead_constant_pass.cpp
103 eliminate_dead_functions_pass.cpp
105 flatten_decoration_pass.cpp
108 fold_spec_constant_op_and_composite_pass.cpp
109 freeze_spec_constant_value_pass.cpp
112 inline_exhaustive_pass.cpp
113 inline_opaque_pass.cpp
115 insert_extract_elim.cpp
121 local_access_chain_convert_pass.cpp
122 local_redundancy_elimination.cpp
123 local_single_block_elim_pass.cpp
124 local_single_store_elim_pass.cpp
125 local_ssa_elim_pass.cpp
129 merge_return_pass.cpp
134 private_to_local_pass.cpp
136 redundancy_elimination.cpp
137 remove_duplicates_pass.cpp
138 replace_invalid_opc.cpp
139 scalar_replacement_pass.cpp
140 set_spec_constant_default_value_pass.cpp
141 simplification_pass.cpp
142 strength_reduction_pass.cpp
143 strip_debug_info_pass.cpp
147 value_number_table.cpp
151 spvtools_default_compile_options(SPIRV-Tools-opt)
152 target_include_directories(SPIRV-Tools-opt
153 PUBLIC ${spirv-tools_SOURCE_DIR}/include
154 PUBLIC ${SPIRV_HEADER_INCLUDE_DIR}
155 PRIVATE ${spirv-tools_BINARY_DIR}
157 # We need the assembling and disassembling functionalities in the main library.
158 target_link_libraries(SPIRV-Tools-opt
159 PUBLIC ${SPIRV_TOOLS})
161 set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries")
162 spvtools_check_symbol_exports(SPIRV-Tools-opt)
164 if(ENABLE_SPIRV_TOOLS_INSTALL)
165 install(TARGETS SPIRV-Tools-opt
166 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
167 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
168 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
169 endif(ENABLE_SPIRV_TOOLS_INSTALL)