Skip to content

Commit f3d682f

Browse files
lwesiersigcbot
authored andcommitted
Add check during parsing clang tool version
1 parent 7a7b484 commit f3d682f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

IGC/cmake/igc_find_opencl_clang.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ elseif(${CCLANG_BUILD_PREBUILDS})
110110
string(REGEX MATCH "clang version ([0-9]*\\.[0-9]*\\.[0-9]*[a-zA-Z0-9]*)" CLANG_TOOL_VERSION "${CLANG_TOOL_V_CALL}")
111111
set(CLANG_TOOL_VERSION "${CMAKE_MATCH_1}")
112112

113+
# Check if we parse clang tool version correctly
114+
if(NOT CLANG_TOOL_VERSION)
115+
message(FATAL_ERROR "[IGC] : Cannot read version of clang tool, please check the output of execution `clang -v` : ${CLANG_TOOL_V_CALL}")
116+
endif()
117+
113118
# Check if llvm version for IGC is newer or equal with the clang-tool version
114119
if(${LLVM_PACKAGE_VERSION} VERSION_GREATER ${CLANG_TOOL_VERSION} OR
115120
${LLVM_PACKAGE_VERSION} EQUAL ${CLANG_TOOL_VERSION})

0 commit comments

Comments
 (0)