Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2021-09-28 20:55:25 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-09-28 21:00:55 +0300
commit86ec9d79eca2a31044a5096df5d5ee244d15708d (patch)
treea33ea71034997d1137b8a43e4d90fc226b4e4315
parente45ffce5fadd55ebead3fd1a89964f330baac526 (diff)
Fix build without Cycles HIP device
-rw-r--r--extern/CMakeLists.txt4
-rw-r--r--intern/cycles/cmake/external_libs.cmake7
-rw-r--r--intern/cycles/cmake/macros.cmake12
-rw-r--r--intern/cycles/device/CMakeLists.txt44
-rw-r--r--intern/cycles/kernel/CMakeLists.txt2
5 files changed, 40 insertions, 29 deletions
diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt
index 2b2cca04503..1fdc8e60167 100644
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@ -67,10 +67,10 @@ endif()
if(WITH_CYCLES OR WITH_COMPOSITOR OR WITH_OPENSUBDIV)
add_subdirectory(clew)
- if(WITH_CUDA_DYNLOAD)
+ if((WITH_CYCLES_DEVICE_CUDA OR WITH_CYCLES_DEVICE_OPTIX) AND WITH_CUDA_DYNLOAD)
add_subdirectory(cuew)
endif()
- if(WITH_HIP_DYNLOAD)
+ if(WITH_CYCLES_DEVICE_HIP AND WITH_HIP_DYNLOAD)
add_subdirectory(hipew)
endif()
endif()
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})