Subject: Re: [Boost-build] accessing compilation date in source file
From: Gevorg Voskanyan (v_gevorg_at_[hidden])
Date: 2010-08-23 12:32:02
Avi Bahra wrote:
>I want to log/store or make available the compilation date
>within the C++ source files, but cant find any references to this
>in the docs. Is this possible with bjam ?
>Any help appreciated.
> Best regards,
You can use the __DATE__ predefined preprocessing symbol. To make the source
file containing it to be always recompiled, use the 'always' rule.
const char * const build_date = __DATE__;
obj build_date : build_date.cpp ;
always build_date ;
exe my_exe : main.cpp build_date ;
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