CMakeLists.txt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # Copyright (c) 2017 Pierre Moreau
  2. # Licensed under the Apache License, Version 2.0 (the "License");
  3. # you may not use this file except in compliance with the License.
  4. # You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software
  9. # distributed under the License is distributed on an "AS IS" BASIS,
  10. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. # See the License for the specific language governing permissions and
  12. # limitations under the License.
  13. add_library(SPIRV-Tools-link
  14. linker.cpp
  15. )
  16. spvtools_default_compile_options(SPIRV-Tools-link)
  17. target_include_directories(SPIRV-Tools-link
  18. PUBLIC ${spirv-tools_SOURCE_DIR}/include
  19. PUBLIC ${SPIRV_HEADER_INCLUDE_DIR}
  20. PRIVATE ${spirv-tools_BINARY_DIR}
  21. )
  22. # We need the IR functionnalities from the optimizer
  23. target_link_libraries(SPIRV-Tools-link
  24. PUBLIC SPIRV-Tools-opt)
  25. set_property(TARGET SPIRV-Tools-link PROPERTY FOLDER "SPIRV-Tools libraries")
  26. spvtools_check_symbol_exports(SPIRV-Tools-link)
  27. if(ENABLE_SPIRV_TOOLS_INSTALL)
  28. install(TARGETS SPIRV-Tools-link
  29. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  30. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  31. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
  32. endif(ENABLE_SPIRV_TOOLS_INSTALL)