CMakeLists.txt 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 ${SPIRV_TOOLS_LIBRARY_TYPE}
  14. linker.cpp
  15. )
  16. spvtools_default_compile_options(SPIRV-Tools-link)
  17. target_include_directories(SPIRV-Tools-link
  18. PUBLIC
  19. $<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
  20. $<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
  21. $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  22. PRIVATE ${spirv-tools_BINARY_DIR}
  23. )
  24. # We need the IR functionalities from the optimizer
  25. target_link_libraries(SPIRV-Tools-link
  26. PUBLIC SPIRV-Tools-opt)
  27. set_property(TARGET SPIRV-Tools-link PROPERTY FOLDER "SPIRV-Tools libraries")
  28. spvtools_check_symbol_exports(SPIRV-Tools-link)
  29. if(ENABLE_SPIRV_TOOLS_INSTALL)
  30. install(TARGETS SPIRV-Tools-link EXPORT SPIRV-Tools-linkTargets)
  31. export(EXPORT SPIRV-Tools-linkTargets FILE SPIRV-Tools-linkTargets.cmake)
  32. spvtools_config_package_dir(SPIRV-Tools-link PACKAGE_DIR)
  33. install(EXPORT SPIRV-Tools-linkTargets FILE SPIRV-Tools-linkTargets.cmake
  34. DESTINATION ${PACKAGE_DIR})
  35. spvtools_generate_config_file(SPIRV-Tools-link)
  36. install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-linkConfig.cmake DESTINATION ${PACKAGE_DIR})
  37. endif(ENABLE_SPIRV_TOOLS_INSTALL)