且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

代码覆盖率GCov不适用于XCode 4.2和iOS SDK 5

更新时间:2023-10-15 19:17:46

GCov是 XCode 4.2不再支持。你会注意到如果你去他们的 man pagefor it ,XCode 4.2不是下拉列表中的一个选项。此外,如果你看一下编译,它使用的是c ++,它链接到llvm-g ++ - 4.2。它们现在是专属的使用Clang / LLVM工具链(反过来经常使用gcc工具链),而不是直接使用gcc工具链。这样做的结果是在XCode4中使用 gcov 不再直接可用。这也会影响使用绕过XCode 4的CMake编译。第一个链接为您提供有关如何更改项目以使用 profile_rt 而非 gcov 。

GCov is no longer supported in XCode 4.2. You'll note that if you go their "man page" for it, XCode 4.2 is not an option in the drop down list. Furthermore, if you look at the compile, it's using "c++", which is linked to llvm-g++-4.2. They now exclusively use the Clang/LLVM tool chain (which in turn often makes use of the gcc tool chain) instead of giving you the option of directly using the gcc tool chain. A consequence of this is that doing code coverage in XCode4 with gcov is no longer directly available. This also can affect compiles using CMake that bypass XCode 4. That first link gives you instructions on how to change your project to use profile_rt instead of gcov.