CMake: Expose Cycles devices support as CMake option
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Feb 2018 09:31:04 +0000 (10:31 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Feb 2018 09:32:32 +0000 (10:32 +0100)
Handy to disable GPU based devices when it's needed to run Valgrind.

CMakeLists.txt
intern/cycles/CMakeLists.txt

index f5b80efef8526fd4f3f92ce7d23b0fe4023a075e..5b2bd2fd460a294bd50acc95f02218301ac64f1e 100644 (file)
@@ -420,6 +420,13 @@ mark_as_advanced(WITH_CYCLES_LOGGING)
 mark_as_advanced(WITH_CYCLES_DEBUG)
 mark_as_advanced(WITH_CYCLES_NATIVE_ONLY)
 
+option(WITH_CYCLES_DEVICE_CUDA                         "Enable Cycles CUDA compute support" ON)
+option(WITH_CYCLES_DEVICE_OPENCL                       "Enable Cycles OpenCL compute support" ON)
+option(WITH_CYCLES_NETWORK                             "Enable Cycles compute over network support (EXPERIMENTAL and unfinished)" OFF)
+mark_as_advanced(WITH_CYCLES_DEVICE_CUDA)
+mark_as_advanced(WITH_CYCLES_DEVICE_OPENCL)
+mark_as_advanced(WITH_CYCLES_NETWORK)
+
 option(WITH_CUDA_DYNLOAD "Dynamically load CUDA libraries at runtime" ON)
 mark_as_advanced(WITH_CUDA_DYNLOAD)
 
index e7b934ec74f357ebafaf4adbdcb13b87a1dd61cc..9df1e91e2390d1f74de0c686472b674517bdfbe3 100644 (file)
@@ -167,8 +167,13 @@ if(WITH_CYCLES_OPENSUBDIV)
        )
 endif()
 
-set(WITH_CYCLES_DEVICE_OPENCL TRUE)
-set(WITH_CYCLES_DEVICE_CUDA TRUE)
+if(WITH_CYCLES_STANDALONE)
+       set(WITH_CYCLES_DEVICE_OPENCL TRUE)
+       set(WITH_CYCLES_DEVICE_CUDA TRUE)
+       # Experimental and unfinished.
+       set(WITH_CYCLES_NETWORK FALSE)
+endif()
+# TODO(sergey): Consider removing it, only causes confusion in interface.
 set(WITH_CYCLES_DEVICE_MULTI TRUE)
 
 if(CYCLES_STANDALONE_REPOSITORY)