From 791f45733a839c4e66ab2e2c2633b76a5f35edb0 Mon Sep 17 00:00:00 2001 From: Shilei Tian Date: Wed, 11 Dec 2024 16:48:18 -0500 Subject: [PATCH] Improve the handling of CMake deduplication (#1450) Certain CMake functions deduplicates arguments by default. For example, if we have two `target_link_options` with both `-Xoffload-linker -opt-A` and then `-Xoffload-linker -opt-B`, the final link command would be `-Xoffload-linker -opt-A -opt-B`, which is not what we want. [ROCm/rccl commit: 7386fac64a1d446ed6b28b1db5c1c20b3d81364f] --- projects/rccl/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/rccl/CMakeLists.txt b/projects/rccl/CMakeLists.txt index 462888207e..a2d7607526 100644 --- a/projects/rccl/CMakeLists.txt +++ b/projects/rccl/CMakeLists.txt @@ -833,7 +833,7 @@ else() message(STATUS "Building shared RCCL library") endif() if (HAVE_KERNARG_PRELOAD) - target_link_options(rccl PRIVATE -Xoffload-linker -mllvm=-amdgpu-kernarg-preload-count=16) + target_link_options(rccl PRIVATE "SHELL:-Xoffload-linker -mllvm=-amdgpu-kernarg-preload-count=16") endif() if(ENABLE_MSCCLPP)