[Qbs] Linking with clang code coverage flags

resurrection at centrum.cz resurrection at centrum.cz
Fri Apr 27 15:22:03 CEST 2018

Indeed I am. Works like a charm. :-) Thank you!
> Od: Christian Kandeler <christian.kandeler at qt.io>
> Komu: qbs at qt-project.org
> Datum: 27.04.2018 15:16
> Předmět: Re: [Qbs] Linking with clang code coverage flags
On Fri, 27 Apr 2018 15:04:59 +0200
 <resurrection at centrum.cz> wrote:
 > I ran into peculiar issue. Trying out the clang code coverage reporting using Source-base Code Coverage <https://clang.llvm.org/docs/SourceBasedCodeCoverage.html <https://clang.llvm.org/docs/SourceBasedCodeCoverage.html>>. The command line examples works as expected. Adapting it to link with Qt and again from the command line it works as expected. However when running it from Qt Creator using Qbs the flags in question: -fprofile-instr-generate, -fcoverage-mapping are not passed to the linker because the compiling and linking are separated in two different commands. When specifying the cpp.linkerFlags in a Qbs Product however the error is printed:
 > /usr/bin/ld: -f may not be used without -shared
 > This is because the flags are being passed via -Wl instead of as flags to clang++. Of course when running it from command line the same error occurs. By specifying -shared as additional linker flag it will show some weird linking error so that is clearly not a way to do it.
 > The way to achieve this I believe is to specify *compiler* flags for *link* call. I am not aware if such a thing is possible in Qbs at the moment. Any ideas?
 I believe you are looking for this:
 https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#driverFlags-prop <https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#driverFlags-prop>
 Qbs mailing list
 Qbs at qt-project.org
 http://lists.qt-project.org/mailman/listinfo/qbs <http://lists.qt-project.org/mailman/listinfo/qbs>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20180427/f4fc2f0a/attachment.html>

More information about the Qbs mailing list