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
21 common_uniform_elim_pass.h
24 dead_branch_elim_pass.h
25 dead_variable_elimination.h
28 eliminate_dead_constant_pass.h
29 flatten_decoration_pass.h
32 fold_spec_constant_op_and_composite_pass.h
33 freeze_spec_constant_value_pass.h
35 inline_exhaustive_pass.h
41 local_access_chain_convert_pass.h
42 local_single_block_elim_pass.h
43 local_single_store_elim_pass.h
53 eliminate_dead_functions_pass.h
54 remove_duplicates_pass.h
55 set_spec_constant_default_value_pass.h
56 strength_reduction_pass.h
57 strip_debug_info_pass.h
62 aggressive_dead_code_elim_pass.cpp
68 common_uniform_elim_pass.cpp
70 decoration_manager.cpp
72 dead_branch_elim_pass.cpp
73 dead_variable_elimination.cpp
74 eliminate_dead_constant_pass.cpp
75 flatten_decoration_pass.cpp
77 fold_spec_constant_op_and_composite_pass.cpp
78 freeze_spec_constant_value_pass.cpp
81 inline_exhaustive_pass.cpp
82 inline_opaque_pass.cpp
83 insert_extract_elim.cpp
87 local_access_chain_convert_pass.cpp
88 local_single_block_elim_pass.cpp
89 local_single_store_elim_pass.cpp
90 local_ssa_elim_pass.cpp
92 eliminate_dead_functions_pass.cpp
93 remove_duplicates_pass.cpp
94 set_spec_constant_default_value_pass.cpp
99 strength_reduction_pass.cpp
100 strip_debug_info_pass.cpp
107 spvtools_default_compile_options(SPIRV-Tools-opt)
108 target_include_directories(SPIRV-Tools-opt
109 PUBLIC ${spirv-tools_SOURCE_DIR}/include
110 PUBLIC ${SPIRV_HEADER_INCLUDE_DIR}
111 PRIVATE ${spirv-tools_BINARY_DIR}
113 # We need the assembling and disassembling functionalities in the main library.
114 target_link_libraries(SPIRV-Tools-opt
115 PUBLIC ${SPIRV_TOOLS})
117 set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries")
119 if(ENABLE_SPIRV_TOOLS_INSTALL)
120 install(TARGETS SPIRV-Tools-opt
121 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
122 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
123 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
124 endif(ENABLE_SPIRV_TOOLS_INSTALL)