Subject: Re: [Boost-build] Automatic version number or build-id
From: Niklas Angare (li51ckf02_at_[hidden])
Date: 2015-09-25 18:22:18
"Vladimir Prus" <vladimir.prus_at_[hidden]> wrote:
> On 19-Sep-15 4:15 PM, 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.
> actually, there are not good examples of this, and no full satisfactory
> solution exists. I attach an somewhat
> passable example though.
Thanks for taking the time!
> With those caveats, if I touch 'hello.cpp' or 'hello2.cpp', then
> 'build-id.cpp' is rebuilt too. If I rerun build
> without changing anything, nothing is rebuilt.
Your example doesn't work for me. build-id.obj gets rebuilt every time I
change a source file, but build.id.cpp is not re-generated.
I've tried with both msvc and qcc toolsets. For the latter I had to replace
$(>) with $(>) as you alluded to.
The result is the same even if I replace
notfile setup-build-id-rebuild : @setup-rebuild : hello build-id ;
notfile setup-build-id-rebuild : @setup-rebuild : hello build-id.cpp ;
I'm running boost-build-2014-10 in Windows. Result of b2 -v:
Boost.Jam Version 2014.03. OS=NT.
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