diff --git a/thrust/thrust/cmake/thrust-config.cmake b/thrust/thrust/cmake/thrust-config.cmake index 7b3d5dfd31..e94c049529 100644 --- a/thrust/thrust/cmake/thrust-config.cmake +++ b/thrust/thrust/cmake/thrust-config.cmake @@ -618,11 +618,17 @@ endmacro() # Wrap the OpenMP flags for CUDA targets function(thrust_fixup_omp_target omp_target) get_target_property(opts ${omp_target} INTERFACE_COMPILE_OPTIONS) - if (opts MATCHES "\\$<\\$:([^>]*)>") - target_compile_options(${omp_target} INTERFACE - $<$:-Xcompiler=${CMAKE_MATCH_1}> - ) - endif() + foreach (opt IN LISTS opts) + if (opts MATCHES "\\$<\\$:SHELL:([^>]*)>") + target_compile_options(${omp_target} INTERFACE + $<$:SHELL:-Xcompiler=${CMAKE_MATCH_1}> + ) + elseif (opts MATCHES "\\$<\\$:([^>]*)>") + target_compile_options(${omp_target} INTERFACE + $<$:-Xcompiler=${CMAKE_MATCH_1}> + ) + endif() + endforeach() endfunction() # This must be a macro instead of a function to ensure that backends passed to