|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-03-17 01:57:56
Miguel Ramos wrote:
> Hello,
>
> I'm having trouble using the JAMDATE built-in variable. I'm using
> Boost.Build for a few months now, and need to replace uses of the
> output of the UNIX date command with something which is platform
> independent.
>
> The problem is I can't get JAMDATE however I use it. Apparently, it is
> expanded to an empty variable.
> The most basic use of it is something like
> <define>BUILD_DATE=\\\"$(JAMDATE)\\\" and what happens is that the
> -DBUILD_DATE=something compiler argument is being omited. If I replace
> that with some other variable which has content, then the argument is
> emited.
>
> I tried using JAMDATE in a constant in Jamroot and bjam tells me that
> the variable is empty.
> I looked into the source file src/jam.c to check if the variable
> definition was inside some conditional compilation directive (maybe my
> bjam on Gentoo Linux is being incorrectly built) but it looks like it
> isn't.
>
> What am I doing wrong? How can I have that preprocessor macro defined?
The JAMDATE is a builtin Jam variable and is defined in the global
module. Use
import modules ;
JAMDATE = [ modules.peek : JAMDATE ] ;
to get that variable in a Jamfile.
HTH,
Volodya
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