Re: [QBS] Linking inter-dependent libraries using gcc

2015-08-09 Thread Richard Weickelt
 I'm trying to link inter-dependent libraries, but as qbs merges the list of
 libraries it seems to be impossible now.

I had a somehow related question some time ago [1] and created QBS-701 [2]
which You may want to support. It addresses the same procedure.

 For example there are two libraries: liba.a and libb.a. liba.a uses symbols
 from libb.a and libb.a uses symbols from liba.a. Then using gcc they must be
 linked with the following command line: -la -lb -la. 

... or by the use of --start-group and --end-group [3]

 But I can't get this
 behavior using cpp.staticLibraries property, because qbs passes each library
 only once. So in such situation the only way is to use low level linkerFlags.

You could try an intermediate static library product with dependencies to
all Your external archives so that these are linked together into one
comprehensive archive. But I'm not sure, if the existing linker rules in QBS
would produce the desired result.

 Things become more complicated if one of this libraries is produced by qbs,
 while another one is an external library. I don't know how to workaround in
 such case without using qbs internals (artifact paths).

Again, could intermediate products help here?

 And finally two inter-dependent libraries built by qbs would produce graph
 cycle error.

Could You maybe solve A--B--A by splitting A into A1 and A2 (but pointing
to the same code) and B only depending on the headers of A1 whereas A2
depends on B?

Richard


[1]
http://lists.qt-project.org/pipermail/qbs/2014-November/001052.html
[2] https://bugreports.qt.io/browse/QBS-701
[3]
http://stackoverflow.com/questions/5651869/gcc-what-are-the-start-group-and-end-group-command-line-options
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] Setting multiple profiles for sub-projects

2015-08-09 Thread Jake Petroules

 On Aug 9, 2015, at 10:19 AM, Stephan Gatzka stephan.gat...@gmail.com wrote:
 
 Hi!
 
 I setup successfully qbs to build my cjet project. For continuous 
 integration I'd like to setup a surrounding qbs file which sets the 
 profiles the cjet project:
 
 Project {
   name: cjet CI
   minimumQbsVersion: 1.4.0
 
   SubProject {
 filePath: cjet.qbs
 Properties {
   name: cjet
   profiles: [gcc, clang]
 }
   }
 
   Product {
 name: cjet continuous integration
 Depends { name: cjet }
 profiles: [gcc, clang]
   }
 }
 
 
 If I use this file. I get the error:
 Product dependency 'cjet' not found for profile 'gcc'.
 
 So it only seem to work if I also set profiles in the cjet.qbs file. But 
 that is something I didn't want to because I often have to cross compile 
 this program and don't know the profile beforehand.
 
 Nevertheless, for a continuous build a selection of some pre-defined 
 profiles would be helpful. Is that possible to be specified in a qbs 
 file like above or do I have to run qbs repeatedly with different profiles?
 
 Regards,
 
 Stephan
 ___
 QBS mailing list
 QBS@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/qbs


You can invoke qbs like this:

qbs build debug profile:gcc debug profile:clang

...and qbs will build your project for both the gcc and clang profiles, in 
parallel. You can specify as many variant+property combinations as you want. 
Another example, which might help to visualize this (of course, don't actually 
type the brackets):

qbs build [debug profile:gcc] [release profile:gcc 
someproperty:somevalue] [release profile:clang cpp.optimization:supercharged]
-- 
Jake Petroules - jake.petroules at petroules.com

___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs