From b4539c272d81019f6e06d0ee7c130079e9ecfb73 Mon Sep 17 00:00:00 2001 From: yf711 <109183385+yf711@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:10:06 -0800 Subject: [PATCH] apply to linux&win --- cmake/onnxruntime_providers_cuda.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/onnxruntime_providers_cuda.cmake b/cmake/onnxruntime_providers_cuda.cmake index e6c9c57281..34926486ed 100644 --- a/cmake/onnxruntime_providers_cuda.cmake +++ b/cmake/onnxruntime_providers_cuda.cmake @@ -160,10 +160,12 @@ endif() # relocatable-device-code=true - if (MSVC AND CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8) + if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 12.8) set_target_properties(${target} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) target_compile_options(${target} PRIVATE "$<$:--relocatable-device-code=true>") - target_compile_options(${target} PRIVATE "$<$:SHELL:-Xcompiler /wd4505>") + if (MSVC) + target_compile_options(${target} PRIVATE "$<$:SHELL:-Xcompiler /wd4505>") + endif() endif() if (UNIX)