[Home]Boost.Build Per Project Requirements

BOOST WIKI | RecentChanges | Preferences | Page List | Links List

Showing revision 5
There was a discussion between David Abrahams and Vladimir Prus about two issues which turned out to be related.
  1. Default requirements for (sub)projects.
  2. Recompiling source files several times.

The first issue has to do with convenience: for example, if one wants to turn on unsigned char for all files in a projects, then requirements for all the targets should contain:

 <gcc><*><cflags>-funsigned-char <borland><*><cflags>-K
which is boring. It was decided that we need a special rule to set requirements. Once it's possible to name projects, the following will work:
 project char-tosser;
 requirements char-tosser :  <gcc><*><cflags>-funsigned-char <borland><*><cflags>-K ;
And similar will work for subprojects:
 subproject src/gui ;
 requirements char-tosser/src/gui : <include>$(QT_INCLUDE_PATH) ;

The second issue is present when one source file is used by several targets. Currently the file will be compiled once for each target which uses it. This behavoiur is due to the fact that main target can have different requirements (different free properties), which can actually affect link compatibility:

 exe calc : calc.cpp : <define>FLOAT_TYPE=double ;
 exe precise_calc : calc.cpp : <define>FLOAT_TYPE="long double" ;
Possible solutions would be:
  1. Make objects files independent targets, and encode all the requirements in path.
  2. Use objects pool. For targets with no requirements, objects are taken from the pool. For other targets, they are compiled the way it happens now. This option works well with per-(sub)project requirements, and it was agreed to use it. (Rationale?)

Here is an example:

 project example ;
 requirements example : <include>$(BOOST_PATH) <threading>multi ;
 exe main : main.cpp routines.cpp ;
 unit-test routines-test : routines-test.cpp routines.cpp ;
Here, routines.cpp will be compiled only once, with projects requirements, and placed in the object pool, to be taken by both main targets. It was agreed that this option is better.

[buy lipitor online] [buy lipitor] [[buy lipitor online]]

[buy fioricet online] [buy fioricet] [[buy fioricet online]]


BOOST WIKI | RecentChanges | Preferences | Page List | Links List
Edit revision 5 of this page | View other revisions | View current revision
Edited August 24, 2008 2:31 pm (diff)
Search:
Disclaimer: This site not officially maintained by Boost Developers