[Bf-blender-cvs] [013d0631e68] master: Add CMake option to control CUDA host compiler
howetuft
noreply at git.blender.org
Wed Apr 6 21:31:17 CEST 2022
Commit: 013d0631e6842230b6043742289bc05de66f6402
Author: howetuft
Date: Mon Mar 7 15:42:47 2022 +0100
Branches: master
https://developer.blender.org/rB013d0631e6842230b6043742289bc05de66f6402
Add CMake option to control CUDA host compiler
This revision allows to specify CUDA host compiler (nvcc's -ccbin command
line option) when configuring the build. It addresses the case where the
C/C++ compiler to be used in CUDA toolchain should be different from the
default C/C++ compiler, for instance in case of compilers versions conflicts
or multiple installed compilers.
The new CMake option is named `CUDA_HOST_COMPILER` and can be used as follows:
`cmake -DCUDA_HOST_COMPILER=<path-to-host-compiler>`
If the option is not specified, the build configuration behaves as previously.
Differential Revision: https://developer.blender.org/D14248
===================================================================
M intern/cycles/kernel/CMakeLists.txt
===================================================================
diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt
index cfd503a621d..d660289ed17 100644
--- a/intern/cycles/kernel/CMakeLists.txt
+++ b/intern/cycles/kernel/CMakeLists.txt
@@ -407,6 +407,11 @@ if(WITH_CYCLES_CUDA_BINARIES)
-o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_file}
-Wno-deprecated-gpu-targets)
+ if(CUDA_HOST_COMPILER)
+ set(cuda_flags ${cuda_flags}
+ -ccbin="${CUDA_HOST_COMPILER}")
+ endif()
+
if(WITH_NANOVDB)
set(cuda_flags ${cuda_flags}
-D WITH_NANOVDB
More information about the Bf-blender-cvs
mailing list