Skip to content

Commit 1c364b6

Browse files
anmyachevwhitneywhtsang
authored andcommitted
Update spirv-llvm-translator.conf with temp patch
1 parent 026120d commit 1c364b6

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

third_party/intel/cmake/FindSPIRVToLLVMTranslator.cmake

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff 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)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cedb8ae2e22102ef85999e0732c3447a307141db
1+
610059c3e287d716a92a8cf8b813549b01d03340

0 commit comments

Comments
 (0)