[CMake] Building against dynamic LLVM system builds fails.
MartinNowack opened this issue · comments
MartinNowack commented
More details here:
Jiri Slaby commented
Yes, this breaks on openSUSE:
: && /var/lib/build/ccache/bin/clang++ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronou
s-unwind-tables -fstack-clash-protection -Werror=return-type -flto=thin -g -O2 -g -DNDEBUG -flto=thin -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now to
ols/ktest-randgen/CMakeFiles/ktest-randgen.dir/ktest-randgen.cpp.o -o bin/ktest-randgen lib/libkleeBasic.a -lLLVMSupport && :
/usr/bin/ld: cannot find -lLLVMSupport: No such file or directory
Jiri Slaby commented
If it helps I use in one of my (abandoned) projects:
set(USE_MAP FALSE)
if (TARGET LLVMSupport)
get_target_property(LLVMSupport_TYPE LLVMSupport TYPE)
if (LLVMSupport STREQUAL SHARED_LIBRARY)
set(USE_MAP TRUE)
endif()
endif()
if (USE_MAP)
llvm_map_components_to_libnames(llvm_libs support core)
else()
set(llvm_libs LLVM)
endif()
message(STATUS "Mapped LLVM libs: ${llvm_libs}")
Jiri Slaby commented
And that works for me:
jirislaby@af721cd
MartinNowack commented
Fixed with #1588