Skip to content

GenerateExportHeader: always fill in _EXPORT macros

Ben Boeckel requested to merge ben.boeckel/cmake:geh-visibility-flag into master

The _EXPORT and _NO_EXPORT macros should always be made properly. If projects do not want hidden visibility by default with GCC, the best solution is to just not use GenerateExportHeader at all and instead let the linker just export everything as it already does. Windows support would then use the WINDOWS_EXPORT_ALL_SYMBOLS property to make the MSVC compiler act like GCC.

In the longer term, this flag should not exist at all and projects would set CMAKE_<LANG>_VISIBILITY_PRESET to control the project-wide visibility settings.


Cc: @robertmaynard

Merge request reports