From 13d78bbf16fdf27f0bd1fcc366817510540e0f1d Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 28 Jul 2023 15:09:26 -0400 Subject: CheckLanguage: Document that CMAKE_CUDA_HOST_COMPILER should not be set alone Follow up commit 7968d9d442 (Help: Document CMAKE_CUDA_HOST_COMPILER as specific to NVIDIA nvcc, 2020-07-14, v3.19.0-rc1~501^2) with an explicit note in `CheckLanguage`. Issue: #25093 --- Modules/CheckLanguage.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index 4c49d9a..04e721c 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -33,6 +33,14 @@ or :command:`project` commands: If the check detects that no explicit host compiler is needed, this variable will be cleared. + If this variable is already set, its value is preserved only if + :variable:`CMAKE_CUDA_COMPILER _COMPILER>` is also set. + Otherwise, the check runs and overwrites + :variable:`CMAKE_CUDA_HOST_COMPILER` with a new result. + Note that :variable:`CMAKE_CUDA_HOST_COMPILER` documents it should + not be set without also setting + :variable:`CMAKE_CUDA_COMPILER _COMPILER>` to a NVCC compiler. + For example: .. code-block:: cmake -- cgit v0.12