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