From 5a77c2e02a568ce17a2571953ea56066f8ca09a3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 2 Jun 2023 09:15:40 -0400 Subject: FindOpenACC: Keep flags together in imported target usage requirements If `OpenACC_C_FLAGS` contains `-h acc`, the flag pair needs to be preserved as a shell command fragment, and must not be split by de-duplication with other `target_compile_options`. Fixes: #24963 --- Modules/FindOpenACC.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/FindOpenACC.cmake b/Modules/FindOpenACC.cmake index 00e42b8..436f5ea 100644 --- a/Modules/FindOpenACC.cmake +++ b/Modules/FindOpenACC.cmake @@ -294,9 +294,9 @@ foreach (LANG IN ITEMS C CXX Fortran) endif() if(OpenACC_${LANG}_FLAGS) set_property(TARGET OpenACC::OpenACC_${LANG} PROPERTY - INTERFACE_COMPILE_OPTIONS "$<$:${OpenACC_${LANG}_OPTIONS}>") + INTERFACE_COMPILE_OPTIONS "$<$:SHELL:${OpenACC_${LANG}_FLAGS}>") set_property(TARGET OpenACC::OpenACC_${LANG} PROPERTY - INTERFACE_LINK_OPTIONS "$<$:${OpenACC_${LANG}_OPTIONS}>") + INTERFACE_LINK_OPTIONS "$<$:SHELL:${OpenACC_${LANG}_FLAGS}>") unset(_OpenACC_${LANG}_OPTIONS) endif() endforeach() -- cgit v0.12