Really enable -fvisibility=hidden for GCC builds
authorJosh Stone <jistone@redhat.com>
Wed, 23 Oct 2013 22:48:50 +0000 (15:48 -0700)
committerJosh Stone <jistone@redhat.com>
Thu, 24 Oct 2013 06:42:09 +0000 (23:42 -0700)
commit98da2f2d52d2a35882924a82788aae8efef68c3f
treee6511dbb133391c5749c949ee3f2d43498dd14e1
parent1e8829db4898d2143e1bc2860bc5667ac979a1ce
Really enable -fvisibility=hidden for GCC builds

The visibility flags were being added after the component directories
were specified, which apparently means those subdirectories don't get
the same flags.  Also, the flags weren't quoted correctly when defined,
and -fvisibility-inlines-hidden is only valid for C++.

Now the flags are defined using cmake/visibility.cmake, mimicking
warnings.cmake, and included in the same place in CMakeLists.txt.

I've found no regressions from this change, and there's a substantial
reduction in the size of the libraries.

Signed-off-by: Josh Stone <jistone@redhat.com>
CMakeLists.txt
cmake/visibility.cmake [new file with mode: 0644]