Skip to content

Commit 372ad32

Browse files
committed
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.
1 parent c9c714c commit 372ad32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/tools/llvm-config/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ foreach(l ${SUPPORT_SYSTEM_LIBS} ${WINDOWSMANIFEST_SYSTEM_LIBS})
2020
set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}")
2121
else()
2222
# Otherwise assume it's a library name we need to link with.
23-
set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
23+
if(IS_ABSOLUTE ${l})
24+
set(SYSTEM_LIBS ${SYSTEM_LIBS} "${l}")
25+
else()
26+
set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}")
27+
endif()
2428
endif()
2529
endif()
2630
endforeach()

0 commit comments

Comments
 (0)