Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-09-12 07:11:23


----- Original Message -----
From: <patrick_at_[hidden]>

> At least under VisualC++, static C++ objects don't get initialized at
program startup. Static objects initialization is postponed until the first
time a function within that module (.cpp) is called. This can be worked
around, but we preferably don't use any libs for this reason.

That just isn't true, and the enclosed project proves it. Jam it
with -sTOOLS=msvc to see it firsthand (note the setting of
BOOST_BUILD_INSTALLATION in the Jamfile, which you may need to customize).

>
> > > 3. No need to write out dependencies at the lowest level
> > > (MinorProject to individual .cpp files)
> >
> > I really have no clue what this one means.
>
> I mean I don't want to write out that the pseudotarget MinorProject11 is
dependent on all .cpp in that directory. I would like a rule called
minorproject which does something like:
>
> rule minorproject # First argument is the pseudotarget
> {
> source_files = all-cpp-files-in-directory($(1))
> DEPENDS $(1) : source_files
> }

Well, you can do it, barely, but it's probably more work than you want to
invest. To do this you have to do write rules and actions that produce the
subproject Jamfile based on the output of DIR, then recursively invoke Jam
to build the subproject. David Turner offered at one point to add a globbing
feature to Jam so I guess solving this problem would be easier. He must be
very busy or he'd be answering more of my emails.

> So I can write:
>
> minorproject MinorProject11
>
> instead of:
>
> DEPENDS MinorProject11 : MinorProject11File1.cpp MinorProject11File2.cpp
MinorProject11File3.cpp
>
> The problem is that new files are added quite often and I don't want to
add them manually, instead I want jam to do it for me :-)

That's not part of Jam's regular capabilities. Anyway, since this list is
really about boost C++ library development and we're getting quite
Jam-specific here, maybe you should post a question to the jamming mailing
list about how this would work.

> Is it possible to write the rule all-cpp-files-in-directory at all? I can
not find any
> clues in sample jamfiles or in the documentation on how to write it.

I think you're getting the picture ;-)

> I suspect all-cpp-files-in-directory can not be written, except by
hardwiring it into the source.

Not quite, but you're close.

> Probably, but I know so little about the system that I don't even know if
it is possible to write a builtin rule that can be used in a jamfile.
Otherwise it could probably be added as a new variable modifier?

I don't have a picture of what you mean.
Anyway, I think David's proposed globbing rule would be the way to go.

-Dave




Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk