From 889467aa7418d9a5a14066df9d49408a045c7fd9 Mon Sep 17 00:00:00 2001 From: Allison Piper Date: Tue, 17 Sep 2024 18:43:24 +0000 Subject: [PATCH] Fix thrust package to work with newer FindOpenMP.cmake. The FindOpenMP module shipped with CMake started (unnecessarily...) including the SHELL: prefix on it's -fopenmp flag. --- thrust/thrust/cmake/thrust-config.cmake | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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