Speed up finding patch components in new boolean.
[blender.git] / intern / cycles / device / CMakeLists.txt
1 # Copyright 2011-2020 Blender Foundation
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 set(INC
16   ..
17   ../../glew-mx
18 )
19
20 set(INC_SYS
21   ${GLEW_INCLUDE_DIR}
22   ../../../extern/clew/include
23 )
24
25 if(WITH_CUDA_DYNLOAD)
26   list(APPEND INC
27     ../../../extern/cuew/include
28   )
29   add_definitions(-DWITH_CUDA_DYNLOAD)
30 else()
31   list(APPEND INC_SYS
32     ${CUDA_TOOLKIT_INCLUDE}
33   )
34   add_definitions(-DCYCLES_CUDA_NVCC_EXECUTABLE="${CUDA_NVCC_EXECUTABLE}")
35 endif()
36
37 set(SRC
38   device.cpp
39   device_cpu.cpp
40   device_cuda.cpp
41   device_denoising.cpp
42   device_dummy.cpp
43   device_memory.cpp
44   device_multi.cpp
45   device_opencl.cpp
46   device_optix.cpp
47   device_split_kernel.cpp
48   device_task.cpp
49 )
50
51 set(SRC_CUDA
52   cuda/device_cuda.h
53   cuda/device_cuda_impl.cpp
54 )
55
56 set(SRC_OPENCL
57   opencl/device_opencl.h
58   opencl/device_opencl_impl.cpp
59   opencl/memory_manager.h
60   opencl/memory_manager.cpp
61   opencl/opencl_util.cpp
62 )
63
64 if(WITH_CYCLES_NETWORK)
65   list(APPEND SRC
66     device_network.cpp
67   )
68 endif()
69
70 set(SRC_HEADERS
71   device.h
72   device_denoising.h
73   device_memory.h
74   device_intern.h
75   device_network.h
76   device_split_kernel.h
77   device_task.h
78 )
79
80 set(LIB
81   cycles_render
82   cycles_kernel
83   cycles_util
84   ${CYCLES_GL_LIBRARIES}
85 )
86
87 if(WITH_CUDA_DYNLOAD)
88   list(APPEND LIB
89     extern_cuew
90   )
91 else()
92   list(APPEND LIB
93     ${CUDA_CUDA_LIBRARY}
94   )
95 endif()
96
97 add_definitions(${GL_DEFINITIONS})
98 if(WITH_CYCLES_NETWORK)
99   add_definitions(-DWITH_NETWORK)
100 endif()
101 if(WITH_CYCLES_DEVICE_OPENCL)
102   list(APPEND LIB
103     extern_clew
104   )
105   add_definitions(-DWITH_OPENCL)
106 endif()
107 if(WITH_CYCLES_DEVICE_CUDA)
108   add_definitions(-DWITH_CUDA)
109 endif()
110 if(WITH_CYCLES_DEVICE_OPTIX)
111   add_definitions(-DWITH_OPTIX)
112 endif()
113 if(WITH_CYCLES_DEVICE_MULTI)
114   add_definitions(-DWITH_MULTI)
115 endif()
116
117 if(WITH_OPENIMAGEDENOISE)
118   add_definitions(-DWITH_OPENIMAGEDENOISE)
119   add_definitions(-DOIDN_STATIC_LIB)
120   list(APPEND INC_SYS
121     ${OPENIMAGEDENOISE_INCLUDE_DIRS}
122   )
123   list(APPEND LIB
124     ${OPENIMAGEDENOISE_LIBRARIES}
125     ${TBB_LIBRARIES}
126   )
127 endif()
128
129 include_directories(${INC})
130 include_directories(SYSTEM ${INC_SYS})
131
132 cycles_add_library(cycles_device "${LIB}" ${SRC} ${SRC_CUDA} ${SRC_OPENCL} ${SRC_HEADERS})