[QBS] How to run a command and get the output

Joerg Bornemann joerg.bornemann at nokia.com
Fri Feb 17 11:13:27 CET 2012


On 16/02/2012 20:57, ext BogDan wrote:

> First and foremost I want to congratulate you for this great tool !

Many thanks! I would love to see qbs used for Android apps! :)

> I'm trying to add android support for qbs, but I'm stuck with a small problem, android needs to add libgcc.a library to link, untill now I used gcc to find where is this library (e.g.  gcc -mthumb-interwork -print-libgcc-file-name  -- will output the path where libgcc is). It is possible to run a command and get the output ?

There's ATM no way to execute a program and read its output. The only 
place for that would be the JavaScriptCommand that is executed on build 
time. We should add support for it.

But for your use case I think the location of libgcc.a should be in the 
platform configuration. The "qbs platforms probe" call created a config 
file in ~/.config/Nokia/qbs/platforms/ and there you should create new 
platform configurations. One for each android target, I'd say.
In there you write the location of libgcc to a property, which is then 
used in android projects. The reasoning is to have the machine-specific 
settings in one place (the platform config) and machine-independent 
settings in the .qbs files.

Of course this should be done by some tool that calls 'gcc 
-mthumb-interwork -print-libgcc-file-name' - like the Necessitas SDK 
installer.


Jörg



More information about the Qbs mailing list