From 2af7637f207c420af602f43e514b1b20e7cfc718 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 14 Jan 2016 12:24:09 +0500 Subject: Cycles: Add option to directly link against CUDA libraries The main purpose of such linking is to make Blender compatible with NVidia's debuggers and profilers which are doing some LD_PRELOAD magic to intercept some function calls. Such magic conflicts with our CUDA wrangler magic and causes segmentation faults. The option is disabled by default, so there's no affect on any of artists. In order to make Blender linked directly against CUDA library use the WITH_CUDA_DYNLOAD CMake option (it's marked as advanced). --- build_files/cmake/macros.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'build_files') diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index cacc741966f..a8e17c3b5ef 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -478,7 +478,11 @@ function(setup_liblinks # We put CLEW and CUEW here because OPENSUBDIV_LIBRARIES dpeends on them.. if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV) target_link_libraries(${target} "extern_clew") - target_link_libraries(${target} "extern_cuew") + if(WITH_CUDA_DYNLOAD) + target_link_libraries(${target} "extern_cuew") + else() + target_link_libraries(${target} ${CUDA_CUDA_LIBRARY}) + endif() endif() #system libraries with no dependencies such as platform link libs or opengl should go last -- cgit v1.2.3