File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,26 @@ if (NOT SPIRVToLLVMTranslator_FOUND)
2121 FetchContent_GetProperties(spirv-llvm-translator)
2222 if (NOT spirv-llvm-translator_POPULATED)
2323 FetchContent_Populate(spirv-llvm-translator)
24+
25+ # FIXME: Don't apply patch when Agama driver is updated.
26+ execute_process (
27+ COMMAND curl -sSL https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/3122.diff
28+ OUTPUT_FILE ${CMAKE_BINARY_DIR} /3122.diff
29+ RESULT_VARIABLE CURL_RESULT
30+ )
31+ if (NOT CURL_RESULT EQUAL 0)
32+ message (FATAL_ERROR "Failed to download patch from https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/3122.diff" )
33+ endif ()
34+
35+ execute_process (
36+ COMMAND git apply ${CMAKE_BINARY_DIR} /3122.diff
37+ WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
38+ RESULT_VARIABLE PATCH_RESULT
39+ )
40+ if (NOT PATCH_RESULT EQUAL 0)
41+ message (FATAL_ERROR "Failed to apply patch to SPIRV-LLVM-Translator" )
42+ endif ()
43+
2444 set (LLVM_CONFIG ${LLVM_LIBRARY_DIR} /../bin/llvm-config)
2545 set (LLVM_DIR "${LLVM_LIBRARY_DIR} /cmake/llvm" CACHE PATH "Path to LLVM build dir " FORCE)
2646 set (LLVM_SPIRV_BUILD_EXTERNAL YES CACHE BOOL "Build SPIRV-LLVM Translator as external" FORCE)
Original file line number Diff line number Diff line change 1- cedb8ae2e22102ef85999e0732c3447a307141db
1+ 610059c3e287d716a92a8cf8b813549b01d03340
You can’t perform that action at this time.
0 commit comments