Boost logo

Boost-Build :

Subject: Re: [Boost-build] Automatic version number or build-id
From: Niklas Angare (li51ckf02_at_[hidden])
Date: 2015-09-25 18:21:23

"Ryan Gonzalez" <rymg19_at_[hidden]> wrote:
> 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 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.
> At the risk of stating the obvious:
> srcs = BuildTime2.cpp ;
> make $(srcs) : : @buildtimecpp : <dependency>$(myfiles) ;
>>> exe MyExe : $(myfiles) $(srcs) ;

I'm afraid you've misunderstood. Paolo's suggestion was to add the
dependencies to the myfiles variable. BuildTime2.cpp is the one exception
that shouldn't be in the variable. My point was that it stops working if you
add a dependency but forget to add it to the variable.

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at