Boost logo

Boost-Build :

From: Rene Rivera (grafikrobot_at_[hidden])
Date: 2006-10-17 12:28:58


Emil Dotchevski wrote:
> Hello,
>
> I'd like to define a lib target such that in its usage requirements, it adds
> a preprocessor define (through -D) when lanuching the msvc compiler, which
> expands to the name of the .cpp file being compiled, similarly to
> __BASE_FILE__ on gcc.
>
> The end result I need is this: when a header file of the said library is
> included in a cpp from another location, the library header file gets the
> name of the including cpp.
>
> Is there an easy way to do this? Note that __BASE_FILE__ is not supported by
> msvc.

I'm assuming that you want the define to change for each file compiled
in the library target?

The only global way I can think of would be to make your own CPP->OBJ
generator that adds the define. Other than that would be hand specifying
each source object compile and add defines for each one (very tedious I
would think).

Volodya may have a more detailed answer ;-)

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

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