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: unassignedb...@nondot.org
          Reporter: neum...@imt.uni-luebeck.de
                CC: htmldevelo...@gmail.com, llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to