From 04b0b15ee42c3b54ae457eb639d9b666a9f5ca8d Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Sun, 24 Oct 2021 19:04:17 +0300 Subject: [PATCH] Link cuda.lib using a preprocessor macro only for non-CMake (#8173) Debian CUDA packages don't ship a shim for the Windows SO cuda.lib, so compilation fails. For CMake it's actually linked using targets, so avoid the preprocessor macro in that case. --- src/dark_cuda.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dark_cuda.c b/src/dark_cuda.c index 8fdaee3f..d155b408 100644 --- a/src/dark_cuda.c +++ b/src/dark_cuda.c @@ -18,14 +18,13 @@ int gpu_index = 0; #include #include +#ifndef USE_CMAKE_LIBS #pragma comment(lib, "cuda.lib") - #ifdef CUDNN -#ifndef USE_CMAKE_LIBS #pragma comment(lib, "cudnn.lib") -#endif // USE_CMAKE_LIBS #endif // CUDNN +#endif // USE_CMAKE_LIBS #if defined(CUDNN_HALF) && !defined(CUDNN) #error "If you set CUDNN_HALF=1 then you must set CUDNN=1"