1
0
mirror of https://github.com/Kitware/CMake.git synced 2025-10-22 16:07:49 +08:00

Help: Improve formatting and fix wording for ENABLE_EXPORTS

This commit is contained in:
Craig Scott
2023-08-06 18:22:51 +10:00
parent 91336d061c
commit 1285fe27ff
2 changed files with 28 additions and 24 deletions

View File

@@ -27,30 +27,33 @@ varies by platform:
referencing the executable since the dynamic loader will referencing the executable since the dynamic loader will
automatically bind symbols when the module is loaded. automatically bind symbols when the module is loaded.
This property is initialized by the value of the variable This property is initialized by the value of the
:variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` if it is set when an executable :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` variable, if it is set when an
target is created. executable target is created. If :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS`
is not set, the :variable:`CMAKE_ENABLE_EXPORTS` variable is used to initialize
the property instead for backward compatibility reasons.
See below for alternative initialization behavior for shared library targets.
.. versionadded:: 3.27 .. versionadded:: 3.27
On macOS, to link with a shared library (standard one as well as framework), On Apple platforms, to link with a shared library (either a bare library or a
a linker import file (e.g. a text-based stubs file, with ``.tbd`` extension) framework), a linker import file can be used instead of the actual shared
can be used instead of the shared library itself. library. These linker import files are also known as text-based stubs, and
they have a ``.tbd`` file extension.
The generation of these linker import files, as well as the consumption, is The generation of these linker import files, as well as their consumption, is
controlled by this property. When this property is set to true, CMake will controlled by this property. When this property is set to true on a shared
generate a ``.tbd`` file for each shared library created by library target, CMake will generate a ``.tbd`` file for the library.
:command:`add_library` command. This allow other targets to use this ``.tbd`` Other targets that link to the shared library target will then use this
file to link to the library with the :command:`target_link_libraries` ``.tbd`` file when linking rather than linking to the shared library binary.
command.
.. note:: .. note::
For compatibility purpose, this property will be ignored if For backward compatibility reasons, this property will be ignored if the
:prop_tgt:`XCODE_ATTRIBUTE_GENERATE_TEXT_BASED_STUBS <XCODE_ATTRIBUTE_<an-attribute>>` :prop_tgt:`XCODE_ATTRIBUTE_GENERATE_TEXT_BASED_STUBS <XCODE_ATTRIBUTE_<an-attribute>>`
target property or the target property or the
:variable:`CMAKE_XCODE_ATTRIBUTE_GENERATE_TEXT_BASED_STUBS <CMAKE_XCODE_ATTRIBUTE_<an-attribute>>` :variable:`CMAKE_XCODE_ATTRIBUTE_GENERATE_TEXT_BASED_STUBS <CMAKE_XCODE_ATTRIBUTE_<an-attribute>>`
variable is set to ``NO``. variable is set to false.
This property is initialized by the value of the variable For shared library targets, this property is initialized by the value of the
:variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS` if it is set when a shared :variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS` variable, if it is set when
library target is created. the target is created.

View File

@@ -9,6 +9,7 @@ This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target
property for executable targets when they are created by calls to the property for executable targets when they are created by calls to the
:command:`add_executable` command. See the property documentation for details. :command:`add_executable` command. See the property documentation for details.
This command has been superseded by the This variable has been superseded by the
:variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` command. It is provided for :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` variable. It is provided for
compatibility with older CMake code. backward compatibility with older CMake code, but should not be used in new
projects.