You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add code coverage to a project using CMake and clang-cl. The first issue I'm hitting is that each clang-cl calls issued by CMake will overwrite the same file : "OutputFolder/.gcno", rather than creating one file per .obj file.
This happens because CMake uses /fo with a directory rather than a file, (which is supported according to clang-cl's usage), but when generating the .gcno file, clang-cl will always interprets /fo as a file.
Example :
"clang-cl.exe" -v /c --coverage "TestFile.cpp" outputs TestFile.obj and TestFile.gcno "clang-cl.exe" -v /c /Fo"Debug\TestFile.obj" --coverage "TestFile.cpp" outputs Debug/TestFile.obj and DebugTestFile.gcno "clang-cl.exe" -v /c /Fo"Debug\" --coverage "TestFile.cpp" outputs Debug/TestFile.obj and Debug/.gcno`
I want to add code coverage to a project using CMake and clang-cl. The first issue I'm hitting is that each clang-cl calls issued by CMake will overwrite the same file : "OutputFolder/.gcno", rather than creating one file per .obj file.
This happens because CMake uses /fo with a directory rather than a file, (which is supported according to clang-cl's usage), but when generating the .gcno file, clang-cl will always interprets /fo as a file.
Example :
"clang-cl.exe" -v /c --coverage "TestFile.cpp"
outputs TestFile.obj and TestFile.gcno"clang-cl.exe" -v /c /Fo"Debug\TestFile.obj" --coverage "TestFile.cpp"
outputs Debug/TestFile.obj and DebugTestFile.gcno"clang-cl.exe" -v /c /Fo"Debug\" --coverage "TestFile.cpp"
outputs Debug/TestFile.obj and Debug/.gcno`Changing this :
llvm-project/clang/lib/Driver/ToolChains/Clang.cpp
Lines 802 to 805 in 49a4ec2
To something like this should work :
If this is the right way, I can provide a patch.
The text was updated successfully, but these errors were encountered: