Boost logo

Boost-Build :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-10-31 19:17:05


John Maddock wrote:
> Hopefully this is an easy one:
>
> How do I make a source file depend upon a FileClone of another file?
>
> Suppose I have a source file in one directory, and I want to copy it to
> another directory and build from there, how do I do it? (Yes I realise it's
> a dumb idea in general, but some test results aren't getting assigned to TR1
> because the actual test source is someplace else in the Boost tree).
>
> At the moment I'm trying:
>
> for local file2 in [ GLOB $(BOOST_ROOT)/libs/config/test :
> has_tr1*fail.cpp ]
> {
> FileClone $(file2) $(BOOST_ROOT)/libs/tr1/test/config/$(file2:B)$(file2:S) ;

Shouldn't that be:

FileClone
$(BOOST_ROOT)/libs/tr1/test/config/$(file2:B)$(file2:S) : $(file2) ;

?

You can also do $(file2:D=) instead of the :B&:S.

> all_rules += [ compile-fail
> $(BOOST_ROOT)/libs/tr1/test/config/$(file2:B)$(file2:S) ] ;
> }
>
> which does copy the files but doesn't build them, because bjam thinks that
> the sources don't exist!
>
> So... what am I doing wrong?

That would be that the compile tests don't depend on the fileclone
targets... But you knew that ;-) The problem is all the target gristed
names not matching from the FileClone to the compile-test. This works
and is simpler:

local config-files =
[ stage config :
[ GLOB $(BOOST_ROOT)/libs/config/test : has_tr1*fail.cpp ] ] ;
for local file2 in $(config-files)
{
local test = [ compile-fail config/$(file2:G=) ] ;
DEPENDS $(test) : $(file2) ;
all_rules += $(test) ;
}

It relies on the "stage" functionality to use the same file/target names
that compile-fail uses internally. And the "DEPENDS" adds the missing
dependency from the test target to the file target.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org
 

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