CMakeLists.txt 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Copyright (c) 2022 Google LLC.
  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. set(SPIRV_TOOLS_DIFF_SOURCES
  14. diff.h
  15. lcs.h
  16. diff.cpp
  17. )
  18. add_library(SPIRV-Tools-diff ${SPIRV_TOOLS_LIBRARY_TYPE} ${SPIRV_TOOLS_DIFF_SOURCES})
  19. spvtools_default_compile_options(SPIRV-Tools-diff)
  20. target_include_directories(SPIRV-Tools-diff
  21. PUBLIC
  22. $<BUILD_INTERFACE:${spirv-tools_SOURCE_DIR}/include>
  23. $<BUILD_INTERFACE:${SPIRV_HEADER_INCLUDE_DIR}>
  24. $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
  25. PRIVATE ${spirv-tools_BINARY_DIR}
  26. )
  27. # We need the assembling and disassembling functionalities in the main library.
  28. target_link_libraries(SPIRV-Tools-diff
  29. PUBLIC ${SPIRV_TOOLS_FULL_VISIBILITY})
  30. # We need the internals of spirv-opt.
  31. target_link_libraries(SPIRV-Tools-diff
  32. PUBLIC SPIRV-Tools-opt)
  33. set_property(TARGET SPIRV-Tools-diff PROPERTY FOLDER "SPIRV-Tools libraries")
  34. spvtools_check_symbol_exports(SPIRV-Tools-diff)
  35. if(ENABLE_SPIRV_TOOLS_INSTALL)
  36. install(TARGETS SPIRV-Tools-diff EXPORT SPIRV-Tools-diffTargets)
  37. export(EXPORT SPIRV-Tools-diffTargets FILE SPIRV-Tools-diffTargets.cmake)
  38. spvtools_config_package_dir(SPIRV-Tools-diff PACKAGE_DIR)
  39. install(EXPORT SPIRV-Tools-diffTargets FILE SPIRV-Tools-diffTargets.cmake
  40. DESTINATION ${PACKAGE_DIR})
  41. spvtools_generate_config_file(SPIRV-Tools-diff)
  42. install(FILES ${CMAKE_BINARY_DIR}/SPIRV-Tools-diffConfig.cmake DESTINATION ${PACKAGE_DIR})
  43. endif(ENABLE_SPIRV_TOOLS_INSTALL)