CMakeBackwardCompatibilityCXX: Update documentation

This describes the module in more details to make upgrading code easier.
This commit is contained in:
Peter Kokot 2025-03-11 14:39:36 +01:00
parent 582cbc541d
commit 9883281982
No known key found for this signature in database
GPG Key ID: A94800907AA79B36

View File

@ -5,16 +5,36 @@
CMakeBackwardCompatibilityCXX
-----------------------------
define a bunch of backwards compatibility variables
This module defines several backward compatibility cache variables for the
``CXX`` language to support early C++ (pre-C++98, ANSI C++).
::
The following modules are included by this module:
CMAKE_ANSI_CXXFLAGS - flag for ansi c++
CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
include(TestForANSIStreamHeaders)
include(CheckIncludeFileCXX)
include(TestForSTDNamespace)
include(TestForANSIForScope)
* :module:`TestForANSIForScope`
* :module:`TestForANSIStreamHeaders`
* :module:`TestForSSTREAM`
* :module:`TestForSTDNamespace`
Additionally, the following cache variable may be defined:
``CMAKE_ANSI_CXXFLAGS``
A space-separated string of compiler options for enabling ANSI C++ mode, if
available.
.. note::
This module is intended for C++ code written before ``C++ 98``. As of the
``C++ 98`` standard, these issues have been formally addressed, making such
checks obsolete.
Examples
^^^^^^^^
Including this module provides backward compatibility cache variables:
.. code-block:: cmake
include(CMakeBackwardCompatibilityCXX)
#]=======================================================================]
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)