Boost logo

Boost-Build :

Subject: [Boost-build] gcc visibility support
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-08-23 14:52:48


I'm interested in adding support for -fvisibility=hidden to the gcc library
compilations.

I can include the following in the Jamfile.v2 of the build directory.

<toolset>gcc:<cxxflags>"-fvisibility=hidden"

which bjam seems to accept without complaint. Indeed the gcc command line
includes -fvisibility=hidden.

So, so good.

But now I have some problems.

a) visibility is supported in version 4+ compilers. What syntax does one
use to specify that that the above should only apply to these compilers.

b) If one is building a static library, presuably the above shouldn't be
included (though it probably does no harm). How does this modify the above
syntax?

c) The cygwin system I use to test has gcc-4.3.4 installed. BUT, the usage
of -fvisibility=hidden evokes a compile time warning for file. The warning
says that visibility is not supported on this build - which presumably is
cygwin. So the above would also have to be conditioned upon the fact that
cygwin is not being used.

any help appreciated.

Robert Ramey


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