diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-09-28 20:55:25 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-09-28 21:00:55 +0300 |
commit | 86ec9d79eca2a31044a5096df5d5ee244d15708d (patch) | |
tree | a33ea71034997d1137b8a43e4d90fc226b4e4315 /intern/cycles | |
parent | e45ffce5fadd55ebead3fd1a89964f330baac526 (diff) |
Fix build without Cycles HIP device
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 7 | ||||
-rw-r--r-- | intern/cycles/cmake/macros.cmake | 12 | ||||
-rw-r--r-- | intern/cycles/device/CMakeLists.txt | 44 | ||||
-rw-r--r-- | intern/cycles/kernel/CMakeLists.txt | 2 |
4 files changed, 38 insertions, 27 deletions
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index 5653f51ec05..b966edd4298 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -531,8 +531,13 @@ if(WITH_CYCLES_CUDA_BINARIES OR NOT WITH_CUDA_DYNLOAD) endif() endif() endif() + + +########################################################################### +# HIP +########################################################################### + if(NOT WITH_HIP_DYNLOAD) - message(STATUS "Setting up HIP Dynamic Load") set(WITH_HIP_DYNLOAD ON) endif() diff --git a/intern/cycles/cmake/macros.cmake b/intern/cycles/cmake/macros.cmake index 172ae280cea..a470fb9c574 100644 --- a/intern/cycles/cmake/macros.cmake +++ b/intern/cycles/cmake/macros.cmake @@ -156,13 +156,15 @@ macro(cycles_target_link_libraries target) ${PLATFORM_LINKLIBS} ) - if(WITH_CUDA_DYNLOAD) - target_link_libraries(${target} extern_cuew) - else() - target_link_libraries(${target} ${CUDA_CUDA_LIBRARY}) + if(WITH_CYCLES_DEVICE_CUDA OR WITH_CYCLES_DEVICE_OPTIX) + if(WITH_CUDA_DYNLOAD) + target_link_libraries(${target} extern_cuew) + else() + target_link_libraries(${target} ${CUDA_CUDA_LIBRARY}) + endif() endif() - if(WITH_HIP_DYNLOAD) + if(WITH_CYCLES_DEVICE_HIP AND WITH_HIP_DYNLOAD) target_link_libraries(${target} extern_hipew) endif() diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt index 9af68550d17..6d33a6f107f 100644 --- a/intern/cycles/device/CMakeLists.txt +++ b/intern/cycles/device/CMakeLists.txt @@ -22,19 +22,21 @@ set(INC_SYS ../../../extern/clew/include ) -if(WITH_CUDA_DYNLOAD) - list(APPEND INC - ../../../extern/cuew/include - ) - add_definitions(-DWITH_CUDA_DYNLOAD) -else() - list(APPEND INC_SYS - ${CUDA_TOOLKIT_INCLUDE} - ) - add_definitions(-DCYCLES_CUDA_NVCC_EXECUTABLE="${CUDA_NVCC_EXECUTABLE}") +if(WITH_CYCLES_DEVICE_OPTIX OR WITH_CYCLES_DEVICE_CUDA) + if(WITH_CUDA_DYNLOAD) + list(APPEND INC + ../../../extern/cuew/include + ) + add_definitions(-DWITH_CUDA_DYNLOAD) + else() + list(APPEND INC_SYS + ${CUDA_TOOLKIT_INCLUDE} + ) + add_definitions(-DCYCLES_CUDA_NVCC_EXECUTABLE="${CUDA_NVCC_EXECUTABLE}") + endif() endif() -if(WITH_HIP_DYNLOAD) +if(WITH_CYCLES_DEVICE_HIP AND WITH_HIP_DYNLOAD) list(APPEND INC ../../../extern/hipew/include ) @@ -127,17 +129,19 @@ set(LIB ${CYCLES_GL_LIBRARIES} ) -if(WITH_CUDA_DYNLOAD) - list(APPEND LIB - extern_cuew - ) -else() - list(APPEND LIB - ${CUDA_CUDA_LIBRARY} - ) +if(WITH_CYCLES_DEVICE_OPTIX OR WITH_CYCLES_DEVICE_CUDA) + if(WITH_CUDA_DYNLOAD) + list(APPEND LIB + extern_cuew + ) + else() + list(APPEND LIB + ${CUDA_CUDA_LIBRARY} + ) + endif() endif() -if(WITH_HIP_DYNLOAD) +if(WITH_CYCLES_DEVICE_HIP AND WITH_HIP_DYNLOAD) list(APPEND LIB extern_hipew ) diff --git a/intern/cycles/kernel/CMakeLists.txt b/intern/cycles/kernel/CMakeLists.txt index 8c2cb2c68de..7b56216e887 100644 --- a/intern/cycles/kernel/CMakeLists.txt +++ b/intern/cycles/kernel/CMakeLists.txt @@ -542,7 +542,7 @@ if(WITH_CYCLES_HIP_BINARIES) -D WITH_NANOVDB -I "${NANOVDB_INCLUDE_DIR}") endif() - + endmacro() set(prev_arch "none") foreach(arch ${CYCLES_HIP_BINARIES_ARCH}) |