Browse Source

CMAKE_ENABLE_EXPORTS: Deprecate variable

This makes it more clear which variable should be used.

Fixes #27357
Peter Kokot 1 month ago
parent
commit
33d9146472

+ 2 - 0
Help/command/try_compile.rst

@@ -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`

+ 1 - 1
Help/manual/cmake-variables.7.rst

@@ -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

+ 6 - 0
Help/release/dev/CMAKE_ENABLE_EXPORTS.rst

@@ -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.

+ 8 - 5
Help/variable/CMAKE_ENABLE_EXPORTS.rst

@@ -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.

+ 6 - 1
Help/variable/CMAKE_EXECUTABLE_ENABLE_EXPORTS.rst

@@ -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.

+ 5 - 0
Help/variable/CMAKE_SHARED_LIBRARY_ENABLE_EXPORTS.rst

@@ -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.