diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-08-24 16:39:52 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-08-24 16:39:52 +0300 |
commit | 61896947d4b75829d4275043e1554bd5eb4d8abb (patch) | |
tree | 77e0404335aaece7f195f45238419a09fc0dd508 /intern/cycles/cmake/external_libs.cmake | |
parent | be0a68f0d10af97a22972d4d415076aef3b45b57 (diff) | |
parent | e65f0337e94242baf868aa2cd90a0b489e38b087 (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'intern/cycles/cmake/external_libs.cmake')
-rw-r--r-- | intern/cycles/cmake/external_libs.cmake | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake index af2f280ae84..aaeb85f700d 100644 --- a/intern/cycles/cmake/external_libs.cmake +++ b/intern/cycles/cmake/external_libs.cmake @@ -628,15 +628,29 @@ endif() # oneAPI ########################################################################### -if (WITH_CYCLES_DEVICE_ONEAPI) +if(WITH_CYCLES_DEVICE_ONEAPI) find_package(SYCL) find_package(LevelZero) - if (SYCL_FOUND AND LEVEL_ZERO_FOUND) + if(SYCL_FOUND AND LEVEL_ZERO_FOUND) message(STATUS "Found oneAPI: ${SYCL_LIBRARY}") message(STATUS "Found Level Zero: ${LEVEL_ZERO_LIBRARY}") + + if(WITH_CYCLES_ONEAPI_BINARIES) + if(NOT OCLOC_INSTALL_DIR) + get_filename_component(_sycl_compiler_root ${SYCL_COMPILER} DIRECTORY) + get_filename_component(OCLOC_INSTALL_DIR "${_sycl_compiler_root}/../lib/ocloc" ABSOLUTE) + unset(_sycl_compiler_root) + endif() + + if(NOT EXISTS ${OCLOC_INSTALL_DIR}) + message(STATUS "oneAPI ocloc not found in ${OCLOC_INSTALL_DIR}, disabling WITH_CYCLES_ONEAPI_BINARIES." + " A different ocloc directory can be set using OCLOC_INSTALL_DIR cmake variable.") + set(WITH_CYCLES_ONEAPI_BINARIES OFF) + endif() + endif() else() - message(STATUS "oneAPI or Level Zero not found, disabling oneAPI device from Cycles") + message(STATUS "oneAPI or Level Zero not found, disabling WITH_CYCLES_DEVICE_ONEAPI") set(WITH_CYCLES_DEVICE_ONEAPI OFF) endif() endif() |