[QBS] Customization for Embedded platforms that has no OS.
christian.kandeler at digia.com
Mon Jul 22 10:39:01 CEST 2013
On 07/21/2013 03:20 PM, Denis Shienkov wrote:
> I had an idea to use a pair of QBS + QtCreator for creation of projects
> for Embedded devices
> which have no OS.
I find it hard to believe that there is "no OS" - the device has to boot
into *something*, and that something would constitute an operating
system. Perhaps you mean "no mainstream OS"?
> But now I looked towards QBS, and I think - that this solution of all
> problems, very interesting
> concept. I think that by means of QBS I can refuse absolutely my plug-in
> (with all its difficulties)
> in its current look, and completely to transfer to QBS support.
> Having sketchy viewed documentation on QBS I found the following
> (interesting for me):
> 1) TargetOS: In documentation is listed the list from several supported
> OS. But in my case of
> the device have no OS. Thus it is necessary to add one more listing like
I don't think so. See below.
> 2) CPU: In documentation there is no "avr" platform (AVR CPU).
> 3) In documentation are listed only the predetermined set of the
> toolchains (GCC, MSVC, etc).
> But for me is not clear about use of "custom" toolchains. For example,
> what if I want to use
> Keil or the IAR compiler...
> Thus I had questions:
> 1. Whether QBS can adapt somehow for cross-assembly of Embedded of
> projects without OS?
> 2. What you can give recommendations for implementation?
What you need is basically the addition of a new toolchain module to
support your compiler. The respective modules live in
share/qbs/modules/cpp/. You would add a new module there (assuming it
should actually go to upstream qbs), probably inheriting from CppModule.
You would make the "condition" property of this module dependent on the
"qbs.targetOS" property, meaning you would require that property to be
equal to whatever name you give to the OS you plan to support (you can
use any string you want, provided it is unique).
I recommend that you take a look at GenericGCC.qbs, genericunix-gcc.qbs,
linux-gcc.qbs etc to see how specialization and platform filtering are done.
> 4. Whether it is necessary to make modifications in source C++ code of
> the QBS (submit new patches),
That should almost never be necessary.
> or it is rather simple to add new modules by means of *.js and/or *.qbs
> 5. Whether QBS depends on QtCreator? I mean whether he receives names of
> toolchains and other
> settings from QtCreator? Or QBS - completely independent entity which
> uses for this purpose own
qbs knows nothing about Qt Creator. Qt Creator can export its Kits to
qbs profiles, though.
More information about the Qbs