1# Copyright (c) 2017 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
15if(SPIRV_BUILD_COMPRESSION)
16  add_library(SPIRV-Tools-comp
17      bit_stream.cpp
18      bit_stream.h
19      huffman_codec.h
20      markv_codec.cpp
21      markv_codec.h
22      markv.cpp
23      markv.h
24      markv_decoder.cpp
25      markv_decoder.h
26      markv_encoder.cpp
27      markv_encoder.h
28      markv_logger.h
29      move_to_front.h
30      move_to_front.cpp)
31
32  spvtools_default_compile_options(SPIRV-Tools-comp)
33  target_include_directories(SPIRV-Tools-comp
34    PUBLIC ${spirv-tools_SOURCE_DIR}/include
35    PUBLIC ${SPIRV_HEADER_INCLUDE_DIR}
36    PRIVATE ${spirv-tools_BINARY_DIR}
37  )
38
39  target_link_libraries(SPIRV-Tools-comp
40    PUBLIC ${SPIRV_TOOLS})
41
42  set_property(TARGET SPIRV-Tools-comp PROPERTY FOLDER "SPIRV-Tools libraries")
43  spvtools_check_symbol_exports(SPIRV-Tools-comp)
44
45  if(ENABLE_SPIRV_TOOLS_INSTALL)
46    install(TARGETS SPIRV-Tools-comp
47      RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
48      LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
49      ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
50  endif(ENABLE_SPIRV_TOOLS_INSTALL)
51
52endif(SPIRV_BUILD_COMPRESSION)
53