1 # Copyright (c) 2017 Pierre Moreau 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-link 15 linker.cpp 16 ) 17 18 spvtools_default_compile_options(SPIRV-Tools-link) 19 target_include_directories(SPIRV-Tools-link 20 PUBLIC ${spirv-tools_SOURCE_DIR}/include 21 PUBLIC ${SPIRV_HEADER_INCLUDE_DIR} 22 PRIVATE ${spirv-tools_BINARY_DIR} 23 ) 24 # We need the IR functionnalities from the optimizer 25 target_link_libraries(SPIRV-Tools-link 26 PUBLIC SPIRV-Tools-opt) 27 28 set_property(TARGET SPIRV-Tools-link PROPERTY FOLDER "SPIRV-Tools libraries") 29 spvtools_check_symbol_exports(SPIRV-Tools-link) 30 31 if(ENABLE_SPIRV_TOOLS_INSTALL) 32 install(TARGETS SPIRV-Tools-link 33 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 34 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 35 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) 36 endif(ENABLE_SPIRV_TOOLS_INSTALL) 37