Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-05-18 03:19:28


On Wednesday 17 May 2006 23:01, Ryan Gallagher wrote:
> Vladimir Prus <ghost <at> cs.msu.su> writes:
> > First of all, why do you have identically named files in subdirectories?
> > For now, I don't understand why this is a such a recurring problem for
> > users -- we had several reports already.

Hi Ryan,

> Your question had been asked on a separate thread, and I get the
> feeling that it's a hint that this is bad practice, but I have yet to hear
> a decent argument for that. Let me explain my personal reasons, which I
> believe match with some other users.
>
> C++ allows you to separate your code by namespaces. Like Boost code,
> our directory layout often matches that of the namespace. Further
> our filenames often match that of our class names.
......
> What I do not understand is why a build system should dictate to us the
> practices we should follow. If it is trying to help users avoid a bad
> design then this conscience decision should be well documented and open to
> discussion.
>
> My concern is simply that currently bbv2 does not seem to have a matching
> concept for namespaces. I would love to discuss the design question on a
> different list, but as far as the topic of this list goes, I believe that
> this concern should be all that matters.

Using name class name in different namespaces is fine, but what I don't
understand if why both files end up in the same main target.

Do you have one main app that compiles all files in your project? That would
explain it -- it typically have one (or even several) libraries per directory
so the problem does not arise for me.

While I think having fine-grained libraries is good idea, I'd agree that
having one exe compiling everything should be a supported use case.

> > Implementation-wise, here are my thoughts:
> >
> > 1. For a Jamfile with a single source location, we can, for all source
> > files below that source location, retain the relative path, no problem.
>
> This is what I am requesting.

Okay.

> > 2. For a Jamfile with several source locations, it's not clear what do
> > to. Say, /foo/src and /bar/src are source locations for one Jamroot, and
> > there are both /foo/src/class.cpp and /bar/src/class.cpp. In this case,
> > we'd need to get those "foo/src" and "bar/src" to the target path?
>
> Going to concepts, you've essentially imported or "using namespace" two
> namespaces containing the same name, which when used would result in an
> ambiguity in any other language. IMHO, BBv2 should still report an
> ambiguity as it does today.

Ok, I'll consider that I can do.

- Volodya

-- 
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build V2: http://boost.org/boost-build2

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