Quicktime: remove backend with the old quicktime API, and keep the QTKit backend.
[blender-staging.git] / build_files / scons / config / win32-vc-config.py
1 import subprocess
2
3 CL_OUT = subprocess.Popen(["cl.exe"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
4 CL_STDOUT, CL_STDERR = CL_OUT.communicate()
5
6 if "17.00." in CL_STDERR:
7     VC_VERSION = '11.0'
8     LCGDIR = '#../lib/windows_vc11'
9 else:
10     VC_VERSION = '9.0'
11     LCGDIR = '#../lib/windows'
12
13 LIBDIR = '${LCGDIR}'
14
15 WITH_BF_FFMPEG = True
16 BF_FFMPEG = LIBDIR +'/ffmpeg'
17 BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc'
18 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
19 if VC_VERSION == '11.0':
20     BF_FFMPEG_LIB = 'avformat-54.lib avcodec-54.lib avdevice-54.lib avutil-52.lib avfilter-3.lib swscale-2.lib swresample-0.lib'
21     BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-54.dll ${BF_FFMPEG_LIBPATH}/avcodec-54.dll ${BF_FFMPEG_LIBPATH}/avdevice-54.dll ${BF_FFMPEG_LIBPATH}/avutil-52.dll ${BF_FFMPEG_LIBPATH}/avfilter-3.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll ${BF_FFMPEG_LIBPATH}/swresample-0.dll'
22 else:
23     BF_FFMPEG_LIB = 'avformat-53.lib avcodec-53.lib avdevice-53.lib avutil-51.lib swscale-2.lib'
24     BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
25
26 BF_PYTHON = LIBDIR + '/python'
27 BF_PYTHON_VERSION = '3.3'
28 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
29 BF_PYTHON_BINARY = 'python'
30 BF_PYTHON_LIB = 'python33'
31 BF_PYTHON_DLL = '${BF_PYTHON_LIB}'
32 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
33
34 WITH_BF_OPENAL = True
35 BF_OPENAL = LIBDIR + '/openal'
36 BF_OPENAL_INC = '${BF_OPENAL}/include '
37 if VC_VERSION == '11.0':
38     BF_OPENAL_LIB = 'OpenAL32'
39 else:
40     BF_OPENAL_LIB = 'wrap_oal'
41 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
42
43 WITH_BF_ICONV = True
44 BF_ICONV = LIBDIR + '/iconv'
45 BF_ICONV_INC = '${BF_ICONV}/include'
46 BF_ICONV_LIB = 'iconv'
47 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
48
49 WITH_BF_JACK = False
50 BF_JACK = LIBDIR + '/jack'
51 BF_JACK_INC = '${BF_JACK}/include ${BF_FFMPEG}/include/msvc'
52 BF_JACK_LIB = 'libjack'
53 BF_JACK_LIBPATH = '${BF_JACK}/lib'
54
55 WITH_BF_SNDFILE = True
56 BF_SNDFILE = LIBDIR + '/sndfile'
57 BF_SNDFILE_INC = '${BF_SNDFILE}/include'
58 BF_SNDFILE_LIB = 'libsndfile-1'
59 BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
60
61 WITH_BF_SDL = True
62 BF_SDL = LIBDIR + '/sdl'
63 BF_SDL_INC = '${BF_SDL}/include'
64 if VC_VERSION == '11.0':
65     BF_SDL_LIB = 'SDL.lib dxguid.lib'
66 else:
67     BF_SDL_LIB = 'SDL.lib'
68 BF_SDL_LIBPATH = '${BF_SDL}/lib'
69
70 BF_PTHREADS = LIBDIR + '/pthreads'
71 BF_PTHREADS_INC = '${BF_PTHREADS}/include'
72 BF_PTHREADS_LIB = 'pthreadVC2'
73 BF_PTHREADS_LIBPATH = '${BF_PTHREADS}/lib'
74
75 WITH_BF_OPENEXR = True
76 WITH_BF_STATICOPENEXR = False
77 BF_OPENEXR = LIBDIR + '/openexr'
78 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR '
79 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
80 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
81 BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
82
83 WITH_BF_DDS = True
84
85 WITH_BF_JPEG = True
86 BF_JPEG = LIBDIR + '/jpeg'
87 BF_JPEG_INC = '${BF_JPEG}/include'
88 BF_JPEG_LIB = 'libjpeg'
89 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
90
91 WITH_BF_PNG = True
92 BF_PNG = LIBDIR + '/png'
93 BF_PNG_INC = '${BF_PNG}/include'
94 BF_PNG_LIB = 'libpng'
95 BF_PNG_LIBPATH = '${BF_PNG}/lib'
96
97 WITH_BF_TIFF = True
98 BF_TIFF = LIBDIR + '/tiff'
99 BF_TIFF_INC = '${BF_TIFF}/include'
100 BF_TIFF_LIB = 'libtiff'
101 BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
102
103 WITH_BF_ZLIB = True
104 BF_ZLIB = LIBDIR + '/zlib'
105 BF_ZLIB_INC = '${BF_ZLIB}/include'
106 BF_ZLIB_LIB = 'libz_st'
107 BF_ZLIB_LIBPATH = '${BF_ZLIB}/lib'
108
109 WITH_BF_INTERNATIONAL = True
110
111 WITH_BF_GAMEENGINE = True
112 WITH_BF_PLAYER = True
113 WITH_BF_OCEANSIM = True
114
115 WITH_BF_BULLET = True
116 BF_BULLET = '#extern/bullet2/src'
117 BF_BULLET_INC = '${BF_BULLET}'
118 BF_BULLET_LIB = 'extern_bullet'
119
120 WITH_BF_ELTOPO = False
121 BF_LAPACK = LIBDIR + '/lapack'
122 BF_LAPACK_LIB = 'libf2c clapack_nowrap BLAS_nowrap'
123 BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
124
125 BF_WINTAB = LIBDIR + '/wintab'
126 BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE'
127
128 WITH_BF_BINRELOC = False
129
130 BF_WITH_FREETYPE = True
131 BF_FREETYPE = LIBDIR + '/freetype'
132 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
133 BF_FREETYPE_LIB = 'freetype2ST'
134 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
135
136 WITH_BF_OPENJPEG = True 
137 BF_OPENJPEG = '#extern/libopenjpeg'
138 BF_OPENJPEG_LIB = ''
139 BF_OPENJPEG_INC = '${BF_OPENJPEG}'
140 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
141
142 WITH_BF_FFTW3 = True
143 BF_FFTW3 = LIBDIR + '/fftw3'
144 BF_FFTW3_INC = '${BF_FFTW3}/include'
145 BF_FFTW3_LIB = 'libfftw'
146 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
147
148 WITH_BF_REDCODE = False  
149 BF_REDCODE_INC = '#extern'
150
151 WITH_BF_COLLADA = True
152 BF_COLLADA = '#source/blender/collada'
153 BF_COLLADA_INC = '${BF_COLLADA}'
154 BF_COLLADA_LIB = 'bf_collada'
155
156 BF_OPENCOLLADA = LIBDIR + '/opencollada'
157 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include/opencollada'
158 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser MathMLSolver xml pcre buffer ftoa UTF'
159 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
160
161 WITH_BF_3DMOUSE = True
162
163 WITH_BF_OPENMP = True
164
165 #Cycles
166 WITH_BF_CYCLES = True 
167
168 WITH_BF_CYCLES_OSL = True
169 WITH_BF_STATICOSL = True
170 BF_OSL = '${LIBDIR}/osl'
171 BF_OSL_INC = '${BF_OSL}/include'
172 BF_OSL_LIBPATH = '${BF_OSL}/lib'
173 BF_OSL_LIB_STATIC = '${BF_OSL_LIBPATH}/oslcomp.lib ${BF_OSL_LIBPATH}/oslexec.lib ${BF_OSL_LIBPATH}/oslquery.lib '
174 BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
175
176 WITH_BF_LLVM = True
177 BF_LLVM = LIBDIR + '/llvm'
178 BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
179     'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
180     'LLVMTarget LLVMMC LLVMCore LLVMObject LLVMRuntimeDyld LLVMSupport'
181 BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
182
183 WITH_BF_OIIO = True
184 BF_OIIO = '${LIBDIR}/openimageio'
185 BF_OIIO_INC = '${BF_OIIO}/include'
186 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
187 BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/OpenImageIO.lib'
188 WITH_BF_STATICOIIO = True
189
190 WITH_BF_OCIO = True
191 BF_OCIO = '${LIBDIR}/opencolorio'
192 BF_OCIO_INC = '${BF_OCIO}/include'
193 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
194 BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/OpenColorIO.lib'
195 WITH_BF_STATICOCIO = True
196
197 WITH_BF_BOOST = True
198 BF_BOOST = '${LIBDIR}/boost'
199 BF_BOOST_INC = '${BF_BOOST}/include'
200 if VC_VERSION == '11.0':
201     BF_BOOST_LIB = 'libboost_date_time-vc110-mt-s-1_53 libboost_filesystem-vc110-mt-s-1_53 libboost_regex-vc110-mt-s-1_53 libboost_system-vc110-mt-s-1_53 libboost_thread-vc110-mt-s-1_53 libboost_wave-vc110-mt-s-1_53'
202     BF_BOOST_LIB_INTERNATIONAL = ' libboost_locale-vc110-mt-s-1_53'
203 else:
204     BF_BOOST_LIB = 'libboost_date_time-vc90-mt-s-1_49 libboost_filesystem-vc90-mt-s-1_49 libboost_regex-vc90-mt-s-1_49 libboost_system-vc90-mt-s-1_49 libboost_thread-vc90-mt-s-1_49 libboost_wave-vc90-mt-s-1_49'
205     BF_BOOST_LIB_INTERNATIONAL = 'libboost_locale-vc90-mt-s-1_49'
206 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
207
208 #CUDA
209 WITH_BF_CYCLES_CUDA_BINARIES = False
210 #BF_CYCLES_CUDA_NVCC = "" # Path to the nvidia compiler
211
212 # Workaround for ptxas.exe crash on VS2012 and cuda 5.5
213 if VC_VERSION == '11.0':
214         BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30']
215 else:
216         BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
217
218 #Ray trace optimization
219 WITH_BF_RAYOPTIMIZATION = True
220 BF_RAYOPTIMIZATION_SSE_FLAGS = ['/arch:SSE']
221
222 #Freestyle
223 WITH_BF_FREESTYLE = True
224
225 WITH_BF_STATICOPENGL = False
226 BF_OPENGL_INC = '${BF_OPENGL}/include'
227 BF_OPENGL_LIBINC = '${BF_OPENGL}/lib'
228 BF_OPENGL_LIB = 'opengl32 glu32'
229 BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
230                          '${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
231                          '${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
232                          
233 CC = 'cl.exe'
234 CXX = 'cl.exe'
235
236 CCFLAGS = ['/nologo', '/J', '/W1', '/Gd', '/wd4018', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267', '/we4013']
237 CXXFLAGS = ['/EHsc']
238 BGE_CXXFLAGS = ['/O2', '/Ob2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE']
239
240 BF_DEBUG_CCFLAGS = ['/Zi', '/Ob0', '/Od', '/FR${TARGET}.sbr']
241
242 CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-D_CRT_SECURE_NO_DEPRECATE', '-DOPJ_STATIC']
243 REL_CFLAGS = []
244 REL_CXXFLAGS = []
245 REL_CCFLAGS = ['-O2', '/Ob2', '-DNDEBUG']
246
247 C_WARN = []
248 CC_WARN = []
249 CXX_WARN = []
250
251 LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
252
253 PLATFORM_LINKFLAGS = ['/SUBSYSTEM:CONSOLE','/MACHINE:IX86','/STACK:2097152','/INCREMENTAL:NO', '/LARGEADDRESSAWARE', '/NODEFAULTLIB:msvcrt.lib', '/NODEFAULTLIB:msvcmrt.lib', '/NODEFAULTLIB:msvcurt.lib', '/NODEFAULTLIB:msvcrtd.lib']
254
255 # # Todo
256 # BF_PROFILE_CCFLAGS = ['-pg', '-g ']
257 # BF_PROFILE_LINKFLAGS = ['-pg']
258 # BF_PROFILE = False
259
260 BF_BSC=False
261
262 if VC_VERSION == '11.0':
263     BF_BUILDDIR = '..\\build\\win32-vc11'
264     BF_INSTALLDIR='..\\install\\win32-vc11'
265 else:
266     BF_BUILDDIR = '..\\build\\win32-vc'
267     BF_INSTALLDIR='..\\install\\win32-vc'