cmake/Help/prop_tgt/DEFINE_SYMBOL.rst

18 lines
676 B
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
DEFINE_SYMBOL
-------------
Define a symbol when compiling this target's sources.
2019-11-11 23:01:05 +01:00
``DEFINE_SYMBOL`` sets the name of the preprocessor symbol defined when
2014-08-03 19:52:23 +02:00
compiling sources in a shared library. If not set here then it is set
2019-11-11 23:01:05 +01:00
to ``target_EXPORTS`` by default (with some substitutions if the target is
2014-08-03 19:52:23 +02:00
not a valid C identifier). This is useful for headers to know whether
they are being included from inside their library or outside to
2023-05-23 16:38:00 +02:00
properly setup dllexport/dllimport decorations on Windows.
On POSIX platforms, this can optionally be used to control the visibility
of symbols.
CMake provides support for such decorations with the :module:`GenerateExportHeader`
module.