Skip to content

Commit dceaf65

Browse files
committed
also link to CUDA::cufft_static in case of BUILD_SHARED_LIBS=OFF
1 parent b236c71 commit dceaf65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/cudaarithm/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 /wd4324 /wd4512 -Wundef -Wmissing-d
99
set(extra_dependencies "")
1010
set(optional_dependencies "")
1111
if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE)
12+
if(UNIX AND NOT BUILD_SHARED_LIBS AND CUDA_VERSION_STRING VERSION_GREATER_EQUAL 9.2 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.23)
13+
set(CUDA_FFT_LIB_EXT "_static_nocallback")
14+
endif()
1215
list(APPEND extra_dependencies CUDA::cudart_static CUDA::nppial${CUDA_LIB_EXT} CUDA::nppc${CUDA_LIB_EXT} CUDA::nppitc${CUDA_LIB_EXT} CUDA::nppig${CUDA_LIB_EXT} CUDA::nppist${CUDA_LIB_EXT} CUDA::nppidei${CUDA_LIB_EXT})
1316
if(HAVE_CUBLAS)
1417
list(APPEND optional_dependencies CUDA::cublas${CUDA_LIB_EXT})
@@ -18,7 +21,8 @@ if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE)
1821
endif()
1922
if(HAVE_CUFFT)
2023
# static version requires seperable compilation which is incompatible with opencv's current library structure
21-
list(APPEND optional_dependencies CUDA::cufft)
24+
# the cufft_static_nocallback variant does not requires seperable compilation. callbacks are currently not used.
25+
list(APPEND optional_dependencies CUDA::cufft${CUDA_FFT_LIB_EXT})
2226
endif()
2327
else()
2428
if(HAVE_CUBLAS)

0 commit comments

Comments
 (0)