From ae3b8ff86c7796c0146d2b014903ed7b7483ca4a Mon Sep 17 00:00:00 2001 From: Illia Silin <98187287+illsilin@users.noreply.github.com> Date: Thu, 8 Aug 2024 07:29:29 -0700 Subject: [PATCH] check if the coerce-illegal-types flag is supported (#1451) --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae22691ab5..c00db26f3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,9 @@ if(NOT WIN32 AND ${hip_VERSION_FLAT} GREATER 600140090) message("Adding the enable-post-misched=0 compiler flag") add_compile_options("SHELL: -mllvm -enable-post-misched=0") endif() -if(NOT WIN32 AND ${hip_VERSION_FLAT} GREATER 600241132 AND ${hip_VERSION_FLAT} LESS 600300000) +set(check-coerce) +check_cxx_compiler_flag(" -mllvm -amdgpu-coerce-illegal-types=1" check-coerce) +if(NOT WIN32 AND check-coerce AND ${hip_VERSION_FLAT} GREATER 600241132 AND ${hip_VERSION_FLAT} LESS 600300000) message("Adding the amdgpu-coerce-illegal-types=1") add_compile_options("SHELL: -mllvm -amdgpu-coerce-illegal-types=1") endif()