|
Boost-Build : |
From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-02-23 22:51:50
Rene Rivera wrote:
> Jody Hagins wrote:
>
>>Here is my next problem. I have a test that checks to see that
>>type_info for anonymous objects is handled correctly. One thing I want
>>to do is have files with the same name, but in different directories,
>>using the same anonymous namespace from a header file. I tried this,
>>but it tries to link the same anon1.o twice.
OK what follows may be of help. It makes the names of the object files
contain the project path of the file so that no two sources will
collide. WARNING: This qualifies as a kludge :-)
rule object-name
{
local obj = [ top-relative-tokens $(<:G=) ] ;
obj = $(obj:J=_) ;
return $(obj:S=$(SUFOBJ):G=$(TARGET_GRIST)) ;
}
run simple.cpp simple_lib.cpp sub/simple_lib.cpp
: # ARGS
: # INPUT FILES
: # REQUIREMENTS
: # TEST NAME
simple
: # DEFAULT BUILDS
debug
;
rule object-name
{
return $(<:D=:S=$(SUFOBJ):G=$(TARGET_GRIST)) ;
}
The second "rule object-name" resets the definition back to the default
implementation. It might be possible to make this less kludgey if
there's need. But I must retire now.
HTH.
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
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