Skip to content

meson: Use -fvisibility=hidden on Unix if supported

Simon McVittie requested to merge smcv/dbus:meson-fvisibility-hidden into master

This avoids accidentally exporting all of our private symbols as part of the LIBDBUS_PRIVATE_x.y.z verdef, including ones that don't need to be visible outside the shared library even when testing internals (_dbus_watch_set_handler is a good example).

Helps: #437


This resolves the Meson half of #437. I haven't attempted to solve the CMake half, but perhaps we don't really need to: if we are changing our recommended production build system on Unix from Autotools to Meson, and only keeping CMake for the benefit of Windows users while Meson MSVC integration becomes more mature, then perhaps it doesn't matter that more private symbols get exported under CMake.

Edited by Simon McVittie

Merge request reports