Boost logo

Boost :

Subject: Re: [boost] questions regarding visibility and b2
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2018-10-27 17:45:38


On 10/27/2018 11:29 AM, Robert Ramey via Boost wrote:
> I've got a few questions about the "visibility" changes for boost.
> My understanding is that "visibility" for gcc and clang are "sort of the
> same thing" as dll import and export are for windows.
> Now we've made "visibility" the "default".
> But this seems kind of weird.  This has been made a b2 feature.  In
> order to run tests, this feature is applied to the b2 command line.
> What's weird is that it's applied to the tests/executables and
> propogated down to libraries which are built.  I actually don't know
> what "visibility" means in the context of building and executable.

It means the same thing that it means for a shared library.
It's possible for a shared library to import symbols from
the main executable. (This usually happens for dynamically
loaded extensions.) visibility controls which symbols are exported.

>  If I
> want to use visibility=global then on the library build, it needs to be
> applied to everything.  It's very weird and doesn't seem in line with
> the windows solution.

<local-visibility> only applies to a specific target.
In a Jamfile, you should use this property instead of
<visibility>. <visibility> is propagated and is the
correct switch for use on the command line.

> Heretofore, I've applied visibility to the library build "by hand" by
> adding the appropriate command line switches to the right places.  <snip>

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at