3 # ***** BEGIN GPL LICENSE BLOCK *****
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
22 # The Original Code is: all of this file.
24 # Contributor(s): Nathan Letwory.
26 # ***** END GPL LICENSE BLOCK *****
30 sources = env.Glob('intern/source/*.c')
31 raysources = env.Glob('intern/raytrace/*.cpp')
33 incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna'
34 incs += ' extern/include ../blenkernel ../imbuf ../blenfont'
35 incs += ' ../include ../blenloader ../../../intern/smoke/extern ../../../intern/mikktspace ../bmesh'
37 cflags_raytrace = env['CCFLAGS']
38 cxxflags_raytrace = env['CXXFLAGS']
43 if env['WITH_BF_SMOKE']:
44 defs.append('WITH_SMOKE')
46 if env['WITH_BF_PYTHON']:
48 incs += ' ' + env['BF_PYTHON_INC']
49 defs.append('WITH_PYTHON')
53 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
54 if env['WITH_BF_RAYOPTIMIZATION']:
55 cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
56 cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
58 if env['OURPLATFORM'] in ('win32-mingw', 'win64-mingw'):
59 if env['WITH_BF_RAYOPTIMIZATION']:
60 cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
61 cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
63 if env['OURPLATFORM'] == 'darwin':
64 if env['MACOSX_ARCHITECTURE'] in ('i386', 'x86_64') and env['WITH_BF_RAYOPTIMIZATION']:
65 cflags_raytrace = env['CFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
66 cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
68 if env['OURPLATFORM'] == 'linux':
69 if env['WITH_BF_RAYOPTIMIZATION']:
70 cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
71 cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
72 incs += ' ../../../extern/binreloc/include'
74 if env['OURPLATFORM'] == 'linuxcross':
75 if env['WITH_BF_RAYOPTIMIZATION']:
76 cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
77 cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
79 if env['WITH_BF_QUICKTIME']:
80 defs.append('WITH_QUICKTIME')
81 incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
83 if env['WITH_BF_OPENEXR']:
84 defs.append('WITH_OPENEXR')
86 if env['WITH_BF_GAMEENGINE']:
87 defs.append('WITH_GAMEENGINE')
89 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
90 incs += ' ' + env['BF_PTHREADS_INC']
93 # HACK: To fix problem with error 'MMX instruction set not enabled' from mmintrin.h
95 if env['OURPLATFORM'] == 'linuxcross':
96 defs.append('__SSE__')
97 defs_raytrace.append('__MMX__')
99 if env['WITH_BF_RAYOPTIMIZATION']:
100 defs.append('__SSE__')
101 defs_raytrace.append('__SSE__')
103 env.BlenderLib ( libname = 'bf_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=145 )
104 env.BlenderLib ( libname = 'bf_render_raytrace', sources = raysources, includes = Split(incs), defines=defs_raytrace, libtype='core', priority=145, compileflags=cflags_raytrace, cxx_compileflags=cxxflags_raytrace )