ff8583e740e0496b4c8167aba155c0b6500f85ce
[platform/upstream/SPIRV-Tools.git] / source / opt / CMakeLists.txt
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 add_library(SPIRV-Tools-opt
15   aggressive_dead_code_elim_pass.h
16   basic_block.h
17   block_merge_pass.h
18   build_module.h
19   cfg_cleanup_pass.h
20   cfg.h
21   common_uniform_elim_pass.h
22   compact_ids_pass.h
23   constants.h
24   dead_branch_elim_pass.h
25   dead_variable_elimination.h
26   decoration_manager.h
27   def_use_manager.h
28   eliminate_dead_constant_pass.h
29   flatten_decoration_pass.h
30   function.h
31   fold.h
32   fold_spec_constant_op_and_composite_pass.h
33   freeze_spec_constant_value_pass.h
34   inline_pass.h
35   inline_exhaustive_pass.h
36   inline_opaque_pass.h
37   insert_extract_elim.h
38   instruction.h
39   ir_loader.h
40   ir_context.h
41   local_access_chain_convert_pass.h
42   local_single_block_elim_pass.h
43   local_single_store_elim_pass.h
44   local_ssa_elim_pass.h
45   log.h
46   module.h
47   null_pass.h
48   reflect.h
49   mem_pass.h
50   pass.h
51   passes.h
52   pass_manager.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
58   types.h
59   type_manager.h
60   unify_const_pass.h
61
62   aggressive_dead_code_elim_pass.cpp
63   basic_block.cpp
64   block_merge_pass.cpp
65   build_module.cpp
66   cfg_cleanup_pass.cpp
67   cfg.cpp
68   common_uniform_elim_pass.cpp
69   compact_ids_pass.cpp
70   decoration_manager.cpp
71   def_use_manager.cpp
72   dead_branch_elim_pass.cpp
73   dead_variable_elimination.cpp
74   eliminate_dead_constant_pass.cpp
75   flatten_decoration_pass.cpp
76   fold.cpp
77   fold_spec_constant_op_and_composite_pass.cpp
78   freeze_spec_constant_value_pass.cpp
79   function.cpp
80   inline_pass.cpp
81   inline_exhaustive_pass.cpp
82   inline_opaque_pass.cpp
83   insert_extract_elim.cpp
84   instruction.cpp
85   ir_loader.cpp
86   ir_context.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
91   module.cpp
92   eliminate_dead_functions_pass.cpp
93   remove_duplicates_pass.cpp
94   set_spec_constant_default_value_pass.cpp
95   optimizer.cpp
96   mem_pass.cpp
97   pass.cpp
98   pass_manager.cpp
99   strength_reduction_pass.cpp
100   strip_debug_info_pass.cpp
101   types.cpp
102   type_manager.cpp
103   unify_const_pass.cpp
104   instruction_list.cpp
105 )
106
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}
112 )
113 # We need the assembling and disassembling functionalities in the main library.
114 target_link_libraries(SPIRV-Tools-opt
115   PUBLIC ${SPIRV_TOOLS})
116
117 set_property(TARGET SPIRV-Tools-opt PROPERTY FOLDER "SPIRV-Tools libraries")
118
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)
125