CMakeLists.txt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Copyright (c) 2016 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. # Add a SPIR-V Tools example. Signature:
  15. # add_spvtools_example(
  16. # TARGET target_name
  17. # SRCS src_file1.cpp src_file2.cpp
  18. # LIBS lib_target1 lib_target2
  19. # )
  20. function(add_spvtools_example)
  21. if (NOT ${SPIRV_SKIP_EXECUTABLES})
  22. set(one_value_args TARGET)
  23. set(multi_value_args SRCS LIBS)
  24. cmake_parse_arguments(
  25. ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN})
  26. add_executable(${ARG_TARGET} ${ARG_SRCS})
  27. spvtools_default_compile_options(${ARG_TARGET})
  28. target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS})
  29. set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools examples")
  30. endif()
  31. endfunction()
  32. add_subdirectory(cpp-interface)