From 2048b60f537bcbd0169daf0f3aded2c0c225435c Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Fri, 17 Jan 2025 20:06:39 +0100 Subject: [PATCH] CheckIPOSupported: Document support for CUDA Support was added for CMake 3.25 by commit 96bc59b1ca (CUDA: Add Device LTO support for nvcc, 2022-04-22, v3.25.0-rc1~359^2). While at it: - Adjust the note about the required policy. - Document which languages are checked when the LANGUAGES option is not specified. --- Modules/CheckIPOSupported.cmake | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake index fe2729514f..4d9f21faac 100644 --- a/Modules/CheckIPOSupported.cmake +++ b/Modules/CheckIPOSupported.cmake @@ -13,7 +13,7 @@ property. .. command:: check_ipo_supported - :: + .. code-block:: cmake check_ipo_supported([RESULT ] [OUTPUT ] [LANGUAGES ...]) @@ -28,13 +28,29 @@ property. Set ```` variable with details about any error. ``LANGUAGES ...`` Specify languages whose compilers to check. - Languages ``C``, ``CXX``, and ``Fortran`` are supported. -It makes no sense to use this module when :policy:`CMP0069` is set to ``OLD`` so -module will return error in this case. See policy :policy:`CMP0069` for details. + The following languages are supported: + + * ``C`` + + * ``CXX`` + + * ``CUDA`` + + .. versionadded:: 3.25 + + * ``Fortran`` + + If this option is not given, the default languages are picked from + the current :prop_gbl:`ENABLED_LANGUAGES` global property. + +.. note:: + + To use ``check_ipo_supported()``, policy :policy:`CMP0069` must be set to + ``NEW``; otherwise, a fatal error will occur. .. versionadded:: 3.13 - Add support for Visual Studio generators. + Support for Visual Studio generators. .. versionadded:: 3.24 The check uses the caller's :variable:`CMAKE__FLAGS`