[QBS] Per file compile switches

Jake Petroules jake.petroules at petroules.com
Sun Aug 16 01:19:03 CEST 2015

> On Aug 15, 2015, at 9:16 AM, Stephan Gatzka <stephan.gatzka at gmail.com> wrote:
> Hi again!
> I miss a functionality I could easily achieve with cmake.
> To make a reproducible build with gcc, I need to call gcc with -frandom-seed=<hash>.
> As the man page of gcc states:
> "The number should be different for every file you compile"
> The hash itself could be easily calculated with qbs.getHash(), but I don't know
> how to call gcc with a parameter that changes for every different file?
> Any suggestions? 
> Regards,
> Stephan
> _______________________________________________
> QBS mailing list
> QBS at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs

Well, you could put each file in its own Group and set cpp.commonCompilerFlags in each Group. I'm not suggesting you actually do this due to the inconvenience, but it raises an interesting question about how we could potentially make something like this more usable.

I think a new property on the cpp module which calculates the hash and adds this flag for you (-frandom-seed=qbs.getHash(input.filePath)?), would be welcome, though.
Jake Petroules - jake.petroules at petroules.com

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

More information about the Qbs mailing list