1fd4e5da5Sopenharmony_ci# Copyright (c) 2016 Google Inc. 2fd4e5da5Sopenharmony_ci# 3fd4e5da5Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 4fd4e5da5Sopenharmony_ci# you may not use this file except in compliance with the License. 5fd4e5da5Sopenharmony_ci# You may obtain a copy of the License at 6fd4e5da5Sopenharmony_ci# 7fd4e5da5Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 8fd4e5da5Sopenharmony_ci# 9fd4e5da5Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 10fd4e5da5Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 11fd4e5da5Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12fd4e5da5Sopenharmony_ci# See the License for the specific language governing permissions and 13fd4e5da5Sopenharmony_ci# limitations under the License. 14fd4e5da5Sopenharmony_ci 15fd4e5da5Sopenharmony_ci# Add a SPIR-V Tools example. Signature: 16fd4e5da5Sopenharmony_ci# add_spvtools_example( 17fd4e5da5Sopenharmony_ci# TARGET target_name 18fd4e5da5Sopenharmony_ci# SRCS src_file1.cpp src_file2.cpp 19fd4e5da5Sopenharmony_ci# LIBS lib_target1 lib_target2 20fd4e5da5Sopenharmony_ci# ) 21fd4e5da5Sopenharmony_cifunction(add_spvtools_example) 22fd4e5da5Sopenharmony_ci if (NOT ${SPIRV_SKIP_EXECUTABLES}) 23fd4e5da5Sopenharmony_ci set(one_value_args TARGET) 24fd4e5da5Sopenharmony_ci set(multi_value_args SRCS LIBS) 25fd4e5da5Sopenharmony_ci cmake_parse_arguments( 26fd4e5da5Sopenharmony_ci ARG "" "${one_value_args}" "${multi_value_args}" ${ARGN}) 27fd4e5da5Sopenharmony_ci 28fd4e5da5Sopenharmony_ci add_executable(${ARG_TARGET} ${ARG_SRCS}) 29fd4e5da5Sopenharmony_ci spvtools_default_compile_options(${ARG_TARGET}) 30fd4e5da5Sopenharmony_ci target_link_libraries(${ARG_TARGET} PRIVATE ${ARG_LIBS}) 31fd4e5da5Sopenharmony_ci set_property(TARGET ${ARG_TARGET} PROPERTY FOLDER "SPIRV-Tools examples") 32fd4e5da5Sopenharmony_ci endif() 33fd4e5da5Sopenharmony_ciendfunction() 34fd4e5da5Sopenharmony_ci 35fd4e5da5Sopenharmony_ciadd_subdirectory(cpp-interface) 36