CMAKE_ENABLE_EXPORTS: Deprecate variable

This makes it more clear which variable should be used.

Fixes #27357
This commit is contained in:
Peter Kokot
2025-11-03 20:58:12 +01:00
parent 3a5a3af5d1
commit 33d9146472
6 changed files with 28 additions and 7 deletions

View File

@@ -320,6 +320,8 @@ Other Behavior Settings
* :variable:`CMAKE_CUDA_RUNTIME_LIBRARY`
* :variable:`CMAKE_ENABLE_EXPORTS`
* :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS`
* :variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS`
* :variable:`CMAKE_EXE_LINKER_FLAGS`, unless using CMake versions
prior to 4.0 without policy :policy:`CMP0056` set to ``NEW``
* :variable:`CMAKE_LINK_SEARCH_START_STATIC`

View File

@@ -483,7 +483,6 @@ Variables that Control the Build
/variable/CMAKE_DEPENDS_USE_COMPILER
/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS
/variable/CMAKE_DLL_NAME_WITH_SOVERSION
/variable/CMAKE_ENABLE_EXPORTS
/variable/CMAKE_EXECUTABLE_ENABLE_EXPORTS
/variable/CMAKE_EXE_LINKER_FLAGS
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
@@ -896,6 +895,7 @@ Deprecated Variables that Control the Build
.. toctree::
:maxdepth: 1
/variable/CMAKE_ENABLE_EXPORTS
/variable/CMAKE_IOS_INSTALL_COMBINED
/variable/CMAKE_LANG_USING_LINKER_MODE
/variable/CMAKE_USE_RELATIVE_PATHS

View File

@@ -0,0 +1,6 @@
CMAKE_ENABLE_EXPORTS
--------------------
* The :variable:`CMAKE_ENABLE_EXPORTS` variable is deprecated in favor of
the :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` and
:variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS` variables.

View File

@@ -3,13 +3,16 @@ CMAKE_ENABLE_EXPORTS
.. versionadded:: 3.4
.. deprecated:: 4.3
This variable has been deprecated in favor of the
:variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` and
:variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS` variables,
which have been available since CMake 3.27.
It is provided for backward compatibility with older CMake code,
but should not be used in new projects.
Specify whether executables export symbols for loadable modules.
This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target
property for executable targets when they are created by calls to the
:command:`add_executable` command. See the property documentation for details.
This variable has been superseded by the
:variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` variable. It is provided for
backward compatibility with older CMake code, but should not be used in new
projects.

View File

@@ -9,4 +9,9 @@ This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target
property for executable targets when they are created by calls to the
:command:`add_executable` command. See the property documentation for details.
This variable supersede the :variable:`CMAKE_ENABLE_EXPORTS` variable.
This variable supersedes the :variable:`CMAKE_ENABLE_EXPORTS` variable.
See Also
^^^^^^^^
* The :variable:`CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS` variable.

View File

@@ -8,3 +8,8 @@ Specify whether shared library generates an import file.
This variable is used to initialize the :prop_tgt:`ENABLE_EXPORTS` target
property for shared library targets when they are created by calls to the
:command:`add_library` command. See the property documentation for details.
See Also
^^^^^^^^
* The :variable:`CMAKE_EXECUTABLE_ENABLE_EXPORTS` variable.