From 372ad32734ecb455f9fb4d0601229ca2dfc78b66 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 3 Dec 2019 08:52:21 -0800 Subject: [PATCH] llvm-config: do not link absolute paths with `-l` When dealing with system libraries which are absolute paths, use the absolute path rather than the `-l` option. This ensures that the system library can be properly linked against. This is needed to enable using proper link dependencies in CMake. --- llvm/tools/llvm-config/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/llvm/tools/llvm-config/CMakeLists.txt b/llvm/tools/llvm-config/CMakeLists.txt index 9ab1d28..16ba54c 100644 --- a/llvm/tools/llvm-config/CMakeLists.txt +++ b/llvm/tools/llvm-config/CMakeLists.txt @@ -20,7 +20,11 @@ foreach(l ${SUPPORT_SYSTEM_LIBS} ${WINDOWSMANIFEST_SYSTEM_LIBS}) set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}") else() # Otherwise assume it's a library name we need to link with. - set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}") + if(IS_ABSOLUTE ${l}) + set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}") + else() + set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}") + endif() endif() endif() endforeach() -- 2.7.4