Commit 0d49383e authored by Milian Wolff's avatar Milian Wolff
Browse files

Break early when we find LLVM

Our custom FindLLVM does not even set LLVM_DIR so the loop never
exited. Now we use LLVM_FOUND instead which works correctly,
making us find LLVM faster and stopping after the highest match
instead of continuing until the lowest version we find.
parent f26cc88e
......@@ -27,9 +27,10 @@
set(KNOWN_VERSIONS 14 13 12 11 10 9 8 7 6.0 5.0 4.0 3.9 3.8)
foreach(version ${KNOWN_VERSIONS})
if (LLVM_DIR OR (DEFINED Clang_FIND_VERSION AND Clang_FIND_VERSION VERSION_GREATER version))
if(LLVM_FOUND OR (DEFINED Clang_FIND_VERSION AND Clang_FIND_VERSION VERSION_GREATER version))
# already found or version doesn't match
break()
endif ()
endif()
find_package(LLVM ${version})
endforeach()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment