@@ -121,8 +121,23 @@ function(libcudacxx_update_language_compat_flags)
121121 get_property (cuda_checked GLOBAL PROPERTY _libcudacxx_cuda_checked DEFINED )
122122 get_property (cxx_warned GLOBAL PROPERTY _libcudacxx_cxx_warned DEFINED )
123123 get_property (cuda_warned GLOBAL PROPERTY _libcudacxx_cuda_warned DEFINED )
124+ get_property (mismatch_warned GLOBAL PROPERTY _libcudacxx_mismatch_warned DEFINED )
124125 get_property (langs GLOBAL PROPERTY ENABLED_LANGUAGES )
125126
127+ message (DEBUG "libcudacxx: Languages: ${langs} " )
128+ message (DEBUG "libcudacxx: cxx_checked: ${cxx_checked} " )
129+ message (DEBUG "libcudacxx: cuda_checked: ${cuda_checked} " )
130+ message (DEBUG "libcudacxx: cxx_warned: ${cxx_warned} " )
131+ message (DEBUG "libcudacxx: cuda_warned: ${cuda_warned} " )
132+ message (DEBUG "libcudacxx: CMAKE_VERSION: ${CMAKE_VERSION} " )
133+ message (DEBUG "libcudacxx: CMAKE_GENERATOR: ${CMAKE_GENERATOR} " )
134+ message (DEBUG "libcudacxx: CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER} " )
135+ message (DEBUG "libcudacxx: CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID} " )
136+ message (DEBUG "libcudacxx: CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION} " )
137+ message (DEBUG "libcudacxx: CMAKE_CUDA_HOST_COMPILER: ${CMAKE_CUDA_HOST_COMPILER} " )
138+ message (DEBUG "libcudacxx: CMAKE_CUDA_HOST_COMPILER_ID: ${CMAKE_CUDA_HOST_COMPILER_ID} " )
139+ message (DEBUG "libcudacxx: CMAKE_CUDA_HOST_COMPILER_VERSION: ${CMAKE_CUDA_HOST_COMPILER_VERSION} " )
140+
126141 if (NOT cxx_warned AND NOT CXX IN_LIST langs)
127142 # gersemi: off
128143 message (VERBOSE "libcudacxx: - CXX language not enabled." )
@@ -162,16 +177,18 @@ function(libcudacxx_update_language_compat_flags)
162177 set (msvc_cuda_host_version ${CMAKE_CUDA_HOST_COMPILER_VERSION} )
163178 elseif (CMAKE_CUDA_HOST_COMPILER STREQUAL CMAKE_CXX_COMPILER)
164179 # Same path, same compiler:
165- set (msvc_cuda_host_id ${msvc_cxx_id } )
166- set (msvc_cuda_host_version ${msvc_cxx_version } )
180+ set (msvc_cuda_host_id ${CMAKE_CXX_COMPILER_ID } )
181+ set (msvc_cuda_host_version ${CMAKE_CXX_COMPILER_VERSION } )
167182 # gersemi: off
168- elseif ((NOT DEFINED CMAKE_CUDA_HOST_COMPILER) AND
183+ elseif ((NOT mismatch_warned) AND
184+ (NOT CMAKE_CUDA_HOST_COMPILER) AND
169185 (NOT libcudacxx_MISMATCHED_HOST_COMPILER))
170186 # For CMake < 3.31, we cannot reliably detect the CUDA host compiler ID.
171187 # Assume that the CUDA host compiler is the same as the CXX compiler.
172188 # Usually a safe assumption but provide an escape hatch for edge cases.
173189 message (STATUS "libcudacxx: - Assuming CUDA host compiler is the same as CXX compiler." )
174190 message (STATUS "libcudacxx: Set libcudacxx_MISMATCHED_HOST_COMPILER=TRUE to disable this." )
191+ define_property (GLOBAL PROPERTY _libcudacxx_mismatch_warned)
175192 set (msvc_cuda_host_id ${CMAKE_CXX_COMPILER_ID} )
176193 set (msvc_cuda_host_version ${CMAKE_CXX_COMPILER_VERSION} )
177194 endif ()
0 commit comments