From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-08-26 09:51:04
[2002-08-26] pfrants wrote:
>First of all I am not sure wether this is the right place for a
>question about the suitability of Boost.Build for our needs. I did
>see a reference to news.gmane.org also.
>I have tried JAM in the past and like it's automatic dependency
>checking and rules based approach very much, not to mention the GLOB
>rule! It took too much tweaking however to handle the directory
>structure we use.
>Our directory structure is as follows:
>Directly under the root directories exist for both executable and
>library source code. Each executable depends upon one or more of the
>libraries. Libraries are divided into projects.
>We have one special requirement: WE DON'T WANT TO COMPILE OUR C++
>CODE INTO LIBRARY FILES. The executables should link directly with
>the object files. The rationale for this is that we use a lot of
>self-registering static objects and they don't get initialized when
>they are in a library. Another solution would be to solve the problem
>in the source code itself by referencing empty initializer functions
>in each of the files from ExeMain.cpp.
>Can Boost.Build handle this elegantly or do I have to give up most of
>it's advantages to handle the no-library requirement?
>I would like to have simple rules like this one (pseudocode :-)) :
>Main Exe1 : Library1/*/*.cpp Library2/*/*.cpp Exe1/Exe1Main.cpp ;
Lib1Sources = [ some-glob-rule-here... ] ;
Lib2Sources = [ some-glob-rule-here... ] ;
exe Exe1 : $(Lib1Sources) $(Lib2Sources) Exe1/Exe1Main.cpp ;
some-glob-rule-here, possibly something like:
[ GLOB *.cpp : Library1/Library1Project1 ]
It's the glob rule that's the tricky part in your situation. But there is
nothing in Boost.Build from including sources from anywhere in your targets.
But I have a question... why isn't a static lib(archive) suitable? It should
not have any problems with static inits for C++... Or at least it works for
me with GCC.
-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq - Grafik666_at_AIM - Grafik_at_[hidden]
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk