[CMake] Reason for deprecation of GenerateExportHeader ?

Hendrik Sattler post at hendrik-sattler.de
Fri Jun 8 18:34:03 EDT 2018



Am 8. Juni 2018 22:38:06 MESZ schrieb "Jean-Michaël Celerier" <jeanmichael.celerier at gmail.com>:
>Hello,
>
>the documentation page
>https://cmake.org/cmake/help/v3.11/module/GenerateExportHeader.html has
>the
>mention :
>
>> This function is deprecated. Set the target properties
>CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN instead.
>
>Why is that so ? I don't know any library that would export either all
>or
>none of its symbols ; functions & types of the public API must always
>be
>chosen manually by the author of the library anyways. The only use of
>CXX_VISIBILITY_PRESET is to set the visibility to hidden by default, so
>that code can then use the export macros defined by the generate_export
>_
>header code to make specific symbols visible.

The deprecation only refers to the ADD_COMPILER_EXPORT_FLAGS, not the whole module.


>Best,
>Jean-Michaël
>
>-------
>Jean-Michaël Celerier
>http://www.jcelerier.name


More information about the CMake mailing list