|
|
@ -185,6 +185,21 @@ if (LLAMA_KOMPUTE)
|
|
|
|
string(REPLACE "." "_" HEADER_FILE_DEFINE "${HEADER_FILE_DEFINE}")
|
|
|
|
string(REPLACE "." "_" HEADER_FILE_DEFINE "${HEADER_FILE_DEFINE}")
|
|
|
|
set(OUTPUT_HEADER_FILE "${HEADER_FILE}")
|
|
|
|
set(OUTPUT_HEADER_FILE "${HEADER_FILE}")
|
|
|
|
message(STATUS "${HEADER_FILE} generating ${HEADER_FILE_DEFINE}")
|
|
|
|
message(STATUS "${HEADER_FILE} generating ${HEADER_FILE_DEFINE}")
|
|
|
|
|
|
|
|
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
|
|
|
|
OUTPUT ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "/*THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT*/" > ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo \"\#ifndef ${HEADER_FILE_DEFINE}\" >> ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo \"\#define ${HEADER_FILE_DEFINE}\" >> ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "namespace kp {" >> ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "namespace shader_data {" >> ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/xxd -i ${spv_file} >> ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "}}" >> ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo \"\#endif // define ${HEADER_FILE_DEFINE}\" >> ${OUTPUT_HEADER_FILE}
|
|
|
|
|
|
|
|
DEPENDS ${spv_file} xxd
|
|
|
|
|
|
|
|
COMMENT "Converting to hpp: ${FILE_NAME} ${CMAKE_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE}/xxd"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
else()
|
|
|
|
add_custom_command(
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${OUTPUT_HEADER_FILE}
|
|
|
|
OUTPUT ${OUTPUT_HEADER_FILE}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "/*THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT*/" > ${OUTPUT_HEADER_FILE}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "/*THIS FILE HAS BEEN AUTOMATICALLY GENERATED - DO NOT EDIT*/" > ${OUTPUT_HEADER_FILE}
|
|
|
@ -198,6 +213,7 @@ if (LLAMA_KOMPUTE)
|
|
|
|
DEPENDS ${spv_file} xxd
|
|
|
|
DEPENDS ${spv_file} xxd
|
|
|
|
COMMENT "Converting to hpp: ${FILE_NAME} ${CMAKE_BINARY_DIR}/bin/xxd"
|
|
|
|
COMMENT "Converting to hpp: ${FILE_NAME} ${CMAKE_BINARY_DIR}/bin/xxd"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endforeach()
|
|
|
|
endfunction()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
|
|