[Qbs] Applying cxxFlags to certain files

Richard Weickelt richard at weickelt.de
Fri Jul 10 10:33:52 CEST 2020


> Hi. I have a code generator, encapsulated in a dedicated Module, producing
> c++ source files. The generator's artifacts are then picked up by the
> "cpp"
> module according to the rules. For such generated files (and for them
> only)
> I would like to pass certain flags to the compiler (to suppress certain
> warnings) but I cannot figure out how. Any ideas are welcome. Regards.

Have a look at the code example here: https://doc.qt.io/qbs/qml-qbslanguageitems-artifact.html

If you use the outputArtifacts property of the Rule item instead, it should work very similar:

outputArtifacts: [{filePath: "myfile.cpp", fileTags: ["cpp"], cpp: { someFlag: "value" }}]


-------------- next part --------------
_______________________________________________
Qbs mailing list
Qbs at qt-project.org
https://lists.qt-project.org/listinfo/qbs


More information about the Qbs mailing list