Boost logo

Boost-Build :

Subject: Re: [Boost-build] Automatic version number or build-id
From: Vladimir Prus (vladimir.prus_at_[hidden])
Date: 2015-09-28 13:58:58


On 26-Sep-15 1:22 AM, Niklas Angare wrote:
> "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.

You're correct, I've declared victory too early. The below example should work better, it's modified in two ways:

- It forces rebuild of cpp file, not obj
- For internal reasons, there are two targets for the cpp file, and I force rebuild of both.

Could you give it a try?

This can be simplified further, but only with core changes, so I wanted to get this version out to you first.

- 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