From 44349e35e76ea3bb0429e61f0ddca2df1a979280 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Fri, 25 May 2018 15:17:03 +0200 Subject: cmake: find_llvm, fix libraries with llvm-config 3.9 llvm-config from llvm 3.9 was broken. Fix handling of improperly returned libraries. From: liblibLLVM-3.9.so.so To: libLLVM-3.9.so Fixes #895. Signed-off-by: Jiri Slaby --- cmake/find_llvm.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/find_llvm.cmake b/cmake/find_llvm.cmake index adf68c4f..8ceed19f 100644 --- a/cmake/find_llvm.cmake +++ b/cmake/find_llvm.cmake @@ -172,7 +172,11 @@ else() set(targets_to_return "") set(created_targets "") foreach (llvm_lib ${_llvm_libs_list}) + # a bug in llvm-config from LLVM 3.9 + string(REGEX REPLACE "lib(libLLVM[-.a-zA-Z0-9]+\\.so)\\.so$" "\\1" llvm_lib "${llvm_lib}") + get_filename_component(llvm_lib_file_name "${llvm_lib}" NAME) + string(REGEX REPLACE "^(lib)?(LLVM[-.a-zA-Z0-9]+)\\..+$" "\\2" target_name "${llvm_lib_file_name}") list(APPEND targets_to_return "${target_name}") if (NOT TARGET "${target_name}") -- cgit 1.4.1