Boost logo

Boost-Build :

From: Ryan Gallagher (ryan.gallagher_at_[hidden])
Date: 2005-11-18 15:25:23


Hi Reece,

Andreas Fredricksson had brought up the question of globbing files with the
same name but in different subdirectories as sources into one target. Please
see the thread: http://tinyurl.com/aolv3

I've finally gotten around to looking at this issue. With this set of changes
to cvs from two nights ago I've been able to do the glob basically the
way we want (I'm writting the convert_source_to_target_name from memory, so
it may not be exactly right.):

utiliy.jam
+ rule convert_source_to_target_name ( name )
+ {
+ import path ;
+ name = [ path.native $(name:S=) ] ;
+
+ # I'm guessing that this is the intent due to generators.jam : 420
+ if [ path.is-rooted $(name) ]
+ {
+ name = $(path:D=) ;
+ }
+
+ return $(name) ;
+ }

generators.jam : 408
+ name = [ utility.convert_source_to_target_name [ $(sources[1]).name ] ] ;
---
- name = [ utility.basename [ $(sources[1]).name ] ] ;

and similarly a few lines down. I'd also want this next piece removed:

generators.jam : 420
- name = $(name:D=)

so for
  Jamfile.v2
  foo1/
       bar_0.cpp
       ...
       bar_n.cpp
  foo2/
       bar_0.cpp
       ...
       bar_m.cpp

instead of [ glob foo1/*.cpp ] [ glob foo2/*.cpp ]
I use [ path.glob foo1 : *.cpp ] [ glob foo2 : *.cpp ]
or [ path.glob . : foo1/*.cpp ] [ glob . : foo2/*.cpp ]
for the sources.

The issue with glob is that it makes an absolute path for this case,
whereas path.glob keeps it relative. I see there is a comment at
project.jam : 909 about the reasoning for this, but I'm not quite sure I see
the situation where the relative path is wrong. I tested with and without
source-location and seemed to get the right result with what I've written,
which had been my guess at the issue. This was only some quick testing though.

Well, hopefully this will at least get this conversation started again.
Cheers,

-Ryan


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