[QBS] propagate compiler options

Marcel Mulder marcel.mulder at xs4all.nl
Sun Jan 11 13:57:01 CET 2015


Thanks for your reaction. I probably have now other choice than doing it like that but I see it as a work-around. 
I also played with SubProjects and Modules but nothing solves my problem. For QT creator I tried the test in this directory "qt-labs-qbs/tests/auto/api/testdata” and that one did also not work.
It is actually strange that something simple like compile options can’t be propagated or that files can be simply added to the files: [] list. For example like:

Export {
	files: [ foo.c ]
}

I tried to look into the code and add it myself, but I have to take more time to understand the structure of the abs sources.

> On 10 Jan 2015, at 19:28, Dmitry Volosnykh <dmitry.volosnykh at gmail.com> wrote:
> 
> This is not direct answer to your question (it is not a propagation), but at least you'll be able to define options in one place and re-use them in several places.
> 
> As far as I remember from QtCreator's sources, common options are moved into a separate .js file which is then imported into every product. Define functions that return desired values and just call them where appropriate.
> 
> On Sat, Jan 10, 2015 at 4:41 PM, Marcel Mulder <marcel.mulder at xs4all.nl <mailto:marcel.mulder at xs4all.nl>> wrote:
> Hi All,
> 
> How can I propagate compiler options to referenced projects?
> For example:
> 
> Project {
>     references: [
>         "kernel/kernel.qbs"
>     ]
> 
>     Product{
>         type: "application"
>         name: “example"
> 
>         Depends { name: "cpp" }
>         Depends { name: "kernel" }
> 
>         cpp.defines: [“THUMB" ]
>         cpp.warningLevel: "all"
>         cpp.treatWarningsAsErrors: true
>         cpp.positionIndependentCode: false
>         cpp.commonCompilerFlags: [
>             "-mcpu=cortex-m4","-mthumb","-mabi=aapcs","-mfloat-abi=hard","-mfpu=fpv4-sp-d16",
>             "-std=gnu99","-flto","-fno-builtin",
>             "-fdata-sections","-ffunction-sections",
>         ]
>         cpp.includePaths: [ "." ]
>         files: [ “main.c" ]
> 
>     }
> }
> 
> I want the source files in kernel.qbs to be compiled with the same compiler options as in the example product. How can I do that?
> 
> Regards, Marcel
> 
> 
> 
> _______________________________________________
> QBS mailing list
> QBS at qt-project.org <mailto: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/20150111/3f26f9a9/attachment.html>


More information about the Qbs mailing list