Boost logo

Boost-Build :

Subject: Re: [Boost-build] Automatic version number or build-id
From: Ryan Gonzalez (rymg19_at_[hidden])
Date: 2015-09-23 19:31:23


On September 23, 2015 6:21:03 PM CDT, Niklas Angare <li51ckf02_at_[hidden]> wrote:
>"Paulo Márcio Figueiredo Alves" <pauloalves1986_at_[hidden]> wrote:
>> On Sat, Sep 19, 2015 at 10:17 AM Niklas Angare
><li51ckf02_at_[hidden]>
>> wrote:
>>> I'm trying to get Boost.Build to generate a source file at build
>time
>>> containing an automatically generated version number or build-id.
>
>> make BuildTime2.cpp : : @buildtimecpp : <dependency>$(myfiles) ;
>> exe MyExe : $(myfiles) BuildTime2.cpp ;
>
>Thanks for the tip. However, it seems a little brittle. If at any point
>in
>the future someone adds dependencies to MyExe without adding them to
>$(myfiles), the build-id won't always be updated when the exe is. I
>could
>put a comment by the exe rule in the jam file, but this may not stop
>someone
>adding <library>somelib to the requirements of the project at the other
>end
>of the long Jamfile.
>
>Any further suggestions?
>

At the risk of stating the obvious:

srcs = BuildTime2.cpp ;
make $(srcs) : : @buildtimecpp : <dependency>$(myfiles) ;
>> exe MyExe : $(myfiles) $(srcs) ;

>Regards,
>
>Niklas Angare
>
>
>_______________________________________________
>Unsubscribe & other changes:
>http://lists.boost.org/mailman/listinfo.cgi/boost-build

-- 
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.

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