diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 7303e07f63db4..e078b67d4e30e 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -121,14 +121,18 @@ endfunction() # NAME # [MIN_VERSION ] # ARCHS -# SRCS [ ...] +# SRCS [ ...] # [FLAGS ...] # [VERSION_MSG [ ...]] # [NO_ARCH_MSG [ ...]] # [GEN_SCRIPT ] # [GEN_GLOB ] -# This will run GEN_SCRIPT once when version and arch checks pass, globbing -# sources matching GEN_GLOB and appending them alongside SRCS. +# This will add SRCS if `CMAKE_CUDA_COMPILER_VERSION` is greater than or equal +# to `MIN_VERSION` and the `cuda_archs_loose_intersection` of `ARCHS` and +# `CUDA_ARCHS` (taken from global scope) is not empty. +# This will also run GEN_SCRIPT (if supplied and the hash of the script does not +# match the latest in the cmake cache), before globbing sources matching +# GEN_GLOB and appending them alongside SRCS. macro(optional_cuda_sources) set(oneValueArgs NAME MIN_VERSION GEN_SCRIPT GEN_GLOB OUT_SRCS_VAR) set(multiValueArgs ARCHS SRCS FLAGS VERSION_MSG NO_ARCH_MSG)