[llvm] 372ad32 - llvm-config: do not link absolute paths with `-l`

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 08:54:21 PST 2019


Author: Saleem Abdulrasool
Date: 2019-12-03T08:54:09-08:00
New Revision: 372ad32734ecb455f9fb4d0601229ca2dfc78b66

URL: https://github.com/llvm/llvm-project/commit/372ad32734ecb455f9fb4d0601229ca2dfc78b66
DIFF: https://github.com/llvm/llvm-project/commit/372ad32734ecb455f9fb4d0601229ca2dfc78b66.diff

LOG: 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.

Added: 
    

Modified: 
    llvm/tools/llvm-config/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-config/CMakeLists.txt b/llvm/tools/llvm-config/CMakeLists.txt
index 9ab1d283bb80..16ba54c0cf2f 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()


        


More information about the llvm-commits mailing list