diff --git a/cmake/util/FindLLVM.cmake b/cmake/util/FindLLVM.cmake index e50c7d0b01d6..297c8d4f777f 100644 --- a/cmake/util/FindLLVM.cmake +++ b/cmake/util/FindLLVM.cmake @@ -34,7 +34,16 @@ macro(find_llvm use_llvm) set(LLVM_CONFIG ${use_llvm}) if(LLVM_CONFIG STREQUAL "ON") find_package(LLVM REQUIRED CONFIG) - llvm_map_components_to_libnames(LLVM_LIBS all) + llvm_map_components_to_libnames(LLVM_LIBS "all") + if (NOT LLVM_LIBS) + message(STATUS "Not found - LLVM_LIBS") + message(STATUS "Fall back to using llvm-config") + set(LLVM_CONFIG "llvm-config") + else() + set(LLVM_CONFIG "ON") + endif() + endif() + if(LLVM_CONFIG STREQUAL "ON") list (FIND LLVM_LIBS "LLVM" _llvm_dynlib_index) if (${_llvm_dynlib_index} GREATER -1) set(LLVM_LIBS LLVM)