[llvm-bugs] [Bug 40877] New: Visual Studio LLVM toolchain clang-cl --coverage option and linker errors
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Feb 27 01:45:54 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40877
Bug ID: 40877
Summary: Visual Studio LLVM toolchain clang-cl --coverage
option and linker errors
Product: new-bugs
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: new bugs
Assignee: unassignedbugs at nondot.org
Reporter: neumann at imt.uni-luebeck.de
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org
So I played with the --coverage option for clang-cl and found that my test
projects where not linking due to missing symbols.
After a bit of search for the symbols I found out that I need to link against
"clang_rt.profile-x86_64.lib". After doing that linking works fine. The problem
however is that linking to the file requires a full path. In my CMake file the
command looks like:
> target_link_libraries(TestObjLib INTERFACE "\$(LLVMInstallDir)\\lib\\clang\\${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\\clang_rt.profile-x86_64.lib")
Personally I would expect one of the following behaviors
a) --coverage automatically adds "clang_rt.profile-x86_64.lib" to the required
dependencies
or
b) I have to manually add "clang_rt.profile-x86_64.lib" as a dependency but
only that and not the full path.
> target_link_libraries(TestObjLib INTERFACE clang_rt.profile-x86_64.lib)
should be enough
This obviously requires the LLVM toolset in VS to add
\$(LLVMInstallDir)\\lib\\clang\\<CLANG_VERSION_PLACEHOLDER>\\lib\\windows\\ to
the library paths.
Other minor details:
clang-cl -help does not list the --coverage option
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190227/b29eb5ae/attachment.html>
More information about the llvm-bugs
mailing list