[build2] How to define a library implementing main()?

Klaim - Joël Lamotte mjklaim at gmail.com
Mon Sep 17 16:10:15 UTC 2018


On Mon, 17 Sep 2018 at 17:21, Boris Kolpackov <boris at codesynthesis.com> wrote:
> I think it should always be a static library (so liba{} instead of lib{})

OK that part I started with but had doubts because of the other issues.

> and we should by default link it in the "whole archive" mode to make sure
> the object file that defines main() gets included. So something along
> these lines:
>
> liba{main}: cxx{main}
> liba{main}: bin.whole = true

Thanks, I think that's the part I forgot from the documentation.
I just tried and after fixing another issue it worked (I checked, it
is indeed mandatory, in addition to other fixes to my script).
The changes are in the develop branch.

I need to investigate more that other issue if it's a bug or I
misunderstood that part of the syntax.
Anyway I'll report in another thread with my feedback on this experience.

Joël



More information about the users mailing list