Skip to content

Commit d8068b2

Browse files
authored
[nfc] simplify llvm version check
Use standard cmake version check functionality rather than hand crafted regex matching. It's more compact and less bug prone
1 parent 61197a3 commit d8068b2

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

interpreter/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ if(builtin_llvm)
275275
set(LLVM_TABLEGEN_EXE "${LLVM_BINARY_DIR}/bin/llvm-tblgen")
276276
endif()
277277
else()
278-
find_package(LLVM REQUIRED CONFIG)
278+
find_package(LLVM ${ROOT_LLVM_VERSION_REQUIRED_MAJOR}.1 REQUIRED CONFIG)
279279
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION} in ${LLVM_CMAKE_DIR}")
280280

281281
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
@@ -320,13 +320,6 @@ else()
320320
include(HandleLLVMOptions)
321321
include(VersionFromVCS)
322322

323-
set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
324-
if (${PACKAGE_VERSION} MATCHES "${ROOT_LLVM_VERSION_REQUIRED_MAJOR}\\.1(|\\.[0-9]+)")
325-
message(STATUS "Using LLVM external library - ${PACKAGE_VERSION}")
326-
else()
327-
message(FATAL_ERROR "LLVM version ${LLVM_PACKAGE_VERSION} different from ROOT supported, please try ${ROOT_LLVM_VERSION_REQUIRED_MAJOR}.1.x")
328-
endif()
329-
330323
if (NOT DEFINED LLVM_INCLUDE_TESTS)
331324
set(LLVM_INCLUDE_TESTS ON)
332325
endif()

0 commit comments

Comments
 (0)