[Bf-blender-cvs] [5af103f] master: Cycles: Reduce scope of some defines set in CMakeLists

Sergey Sharybin noreply at git.blender.org
Thu Jan 14 09:12:55 CET 2016


Commit: 5af103fe008aac0cb20631871bbee16f319835ed
Author: Sergey Sharybin
Date:   Tue Jan 12 20:50:43 2016 +0500
Branches: master
https://developer.blender.org/rB5af103fe008aac0cb20631871bbee16f319835ed

Cycles: Reduce scope of some defines set in CMakeLists

Should be no functional changes at all, just speeds up re-compilation
when some features needs to be disabled for development purposes.

For example, when running lots of Valgrind it's handy to disable any
GPU devices because otherwise you'll be wasting quite some time in
the driver while enumerating devices.

Reviewers: dingto, lukasstockner97, brecht, juicyfruit

Differential Revision: https://developer.blender.org/D1730

===================================================================

M	intern/cycles/CMakeLists.txt
M	intern/cycles/blender/CMakeLists.txt
M	intern/cycles/device/CMakeLists.txt
M	intern/cycles/subd/CMakeLists.txt

===================================================================

diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt
index c118f4c..6d1c6bf 100644
--- a/intern/cycles/CMakeLists.txt
+++ b/intern/cycles/CMakeLists.txt
@@ -126,10 +126,6 @@ add_definitions(
 	-DCCL_NAMESPACE_END=}
 )
 
-if(WITH_CYCLES_NETWORK)
-	add_definitions(-DWITH_NETWORK)
-endif()
-
 if(WITH_CYCLES_STANDALONE_GUI)
 	add_definitions(-DWITH_CYCLES_STANDALONE_GUI)
 endif()
@@ -138,10 +134,6 @@ if(WITH_CYCLES_PTEX)
 	add_definitions(-DWITH_PTEX)
 endif()
 
-if(WITH_CYCLES_OPENSUBDIV)
-	add_definitions(-DWITH_OPENSUBDIV)
-endif()
-
 if(WITH_CYCLES_OSL)
 	add_definitions(-DWITH_OSL)
 	add_definitions(-DOSL_STATIC_LIBRARY)
@@ -151,11 +143,9 @@ if(WITH_CYCLES_OSL)
 	)
 endif()
 
-add_definitions(
-	-DWITH_OPENCL
-	-DWITH_CUDA
-	-DWITH_MULTI
-)
+set(WITH_CYCLES_DEVICE_OPENCL TRUE)
+set(WITH_CYCLES_DEVICE_CUDA TRUE)
+set(WITH_CYCLES_DEVICE_MULTI TRUE)
 
 if(CYCLES_STANDALONE_REPOSITORY)
 	TEST_UNORDERED_MAP_SUPPORT()
diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt
index c6a2b91..a8cc490 100644
--- a/intern/cycles/blender/CMakeLists.txt
+++ b/intern/cycles/blender/CMakeLists.txt
@@ -52,6 +52,10 @@ set(ADDON_FILES
 
 add_definitions(${GL_DEFINITIONS})
 
+if(WITH_CYCLES_NETWORK)
+	add_definitions(-DWITH_NETWORK)
+endif()
+
 blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}")
 
 # avoid link failure with clang 3.4 debug
diff --git a/intern/cycles/device/CMakeLists.txt b/intern/cycles/device/CMakeLists.txt
index 220b16b..4d962f5 100644
--- a/intern/cycles/device/CMakeLists.txt
+++ b/intern/cycles/device/CMakeLists.txt
@@ -46,6 +46,18 @@ set(SRC_HEADERS
 )
 
 add_definitions(${GL_DEFINITIONS})
+if(WITH_CYCLES_NETWORK)
+	add_definitions(-DWITH_NETWORK)
+endif()
+if(WITH_CYCLES_DEVICE_OPENCL)
+	add_definitions(-DWITH_OPENCL)
+endif()
+if(WITH_CYCLES_DEVICE_CUDA)
+	add_definitions(-DWITH_CUDA)
+endif()
+if(WITH_CYCLES_DEVICE_MULTI)
+	add_definitions(-DWITH_MULTI)
+endif()
 
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})
diff --git a/intern/cycles/subd/CMakeLists.txt b/intern/cycles/subd/CMakeLists.txt
index 2641f6d..1ccf80d 100644
--- a/intern/cycles/subd/CMakeLists.txt
+++ b/intern/cycles/subd/CMakeLists.txt
@@ -25,6 +25,10 @@ set(SRC_HEADERS
 	subd_split.h
 )
 
+if(WITH_CYCLES_OPENSUBDIV)
+	add_definitions(-DWITH_OPENSUBDIV)
+endif()
+
 include_directories(${INC})
 include_directories(SYSTEM ${INC_SYS})




More information about the Bf-blender-cvs mailing list