From ae7f54e6a72e7754fa1265f1d54f2c9392fac6b1 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 14 Jan 2025 13:13:56 -0500 Subject: [PATCH] Clang/CUDA: Fix language-wide flags when linking .so with compiler driver In commit cfa888a6e2 (Clang/CUDA: Add language-wide flags when linking with compiler driver, 2024-10-07, v3.31.0-rc1~12^2) we added the wrong placeholder to `CMAKE_CUDA_CREATE_SHARED_LIBRARY` to represent the language-wide flags. The `` placeholder is for executables. The `` placeholder is for shared libraries. The distinction is for historical reasons. Fixes: #26563 --- Modules/Compiler/Clang-CUDA.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Compiler/Clang-CUDA.cmake b/Modules/Compiler/Clang-CUDA.cmake index 57d3a934d7..3874921c90 100644 --- a/Modules/Compiler/Clang-CUDA.cmake +++ b/Modules/Compiler/Clang-CUDA.cmake @@ -28,7 +28,7 @@ set(CMAKE_CUDA_DEVICE_LINKER_WRAPPER_FLAG_SEP ${CMAKE_CUDA_LINKER_WRAPPER_FLAG_S # RulePlaceholderExpander expands crosscompile variables like sysroot and target only for CMAKE__COMPILER. Override the default. set(CMAKE_CUDA_LINK_EXECUTABLE " -o ${__IMPLICIT_LINKS}") -set(CMAKE_CUDA_CREATE_SHARED_LIBRARY " -o ${__IMPLICIT_LINKS}") +set(CMAKE_CUDA_CREATE_SHARED_LIBRARY " -o ${__IMPLICIT_LINKS}") set(CMAKE_CUDA_RUNTIME_LIBRARY_DEFAULT "STATIC") set(CMAKE_CUDA_RUNTIME_LIBRARY_LINK_OPTIONS_STATIC "cudadevrt;cudart_static")