1 cmake_minimum_required(VERSION 3.22.1) 2 project(spirv_backend) 3 4 set(CMAKE_CXX_STANDARD 14) 5 6 if ("${SPIRV_BACKEND}EMPTY" STREQUAL "EMPTY") 7 set (SPIRV_BACKEND "${CMAKE_SOURCE_DIR}") 8 message("SPIRV_BACKEND=${SPIRV_BACKEND}") 9 endif() 10 11 if ("${SHARED_BACKEND}EMPTY" STREQUAL "EMPTY") 12 set (SHARED_BACKEND "${CMAKE_SOURCE_DIR}/../shared") 13 message("SHARED_BACKEND=${SHARED_BACKEND}") 14 endif() 15 16 message("SPIRV") 17 18 include_directories( 19 ${SPIRV_BACKEND}/include 20 ${SHARED_BACKEND}/include 21 ${SPIRV_INCLUDE_DIR} 22 ) 23 link_directories( 24 ${CMAKE_BINARY_DIR} 25 ) 26 27 add_library(spirv_backend SHARED 28 ${SHARED_BACKEND}/cpp/shared.cpp 29 ${SPIRV_BACKEND}/cpp/spirv_backend.cpp 30 ) 31 32 add_executable(spirv_info 33 ${SPIRV_BACKEND}/cpp/info.cpp 34 ) 35 36 target_link_libraries(spirv_info 37 spirv_backend 38 ) 39 40