UI: Refactor timecode functions into BLI_timecode
[blender.git] / source / blender / render / SConscript
1 #!/usr/bin/env python
2 #
3 # ***** BEGIN GPL LICENSE BLOCK *****
4 #
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.
9 #
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.
14 #
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.
18 #
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
21 #
22 # The Original Code is: all of this file.
23 #
24 # Contributor(s): Nathan Letwory.
25 #
26 # ***** END GPL LICENSE BLOCK *****
27
28 Import ('env')
29
30 sources = env.Glob('intern/source/*.c')
31 raysources = env.Glob('intern/raytrace/*.cpp')
32
33 incs = [
34     'extern/include',
35     'intern/include',
36     '#/intern/guardedalloc',
37     '../blenfont',
38     '../blenkernel',
39     '../blenlib',
40     '../imbuf',
41     '../include',
42     '../makesdna',
43     '../makesrna',
44     '../../../intern/mikktspace',
45     '../../../intern/smoke/extern',
46     ]
47 incs = ' '.join(incs)
48
49 cflags_raytrace = env['CCFLAGS']
50 cxxflags_raytrace = env['CXXFLAGS']
51
52 defs = []
53 defs_raytrace = []
54
55 if env['WITH_BF_SMOKE']:
56     defs.append('WITH_SMOKE')
57
58 if env['WITH_BF_PYTHON']:
59     incs += ' ../python'
60     defs.append('WITH_PYTHON')
61     if env['BF_DEBUG']:
62         defs.append('DEBUG')
63
64 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
65     if env['WITH_BF_RAYOPTIMIZATION']:
66         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
67         cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
68
69 if env['OURPLATFORM'] in ('win32-mingw', 'win64-mingw'):
70     if env['WITH_BF_RAYOPTIMIZATION']:
71         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
72         cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
73
74 if env['OURPLATFORM'] == 'darwin':
75     if env['MACOSX_ARCHITECTURE'] in ('i386', 'x86_64') and env['WITH_BF_RAYOPTIMIZATION']:
76         cflags_raytrace = env['CFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
77         cxxflags_raytrace = env['CXXFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
78         
79 if env['OURPLATFORM'] == 'linux':
80     if env['WITH_BF_RAYOPTIMIZATION']:
81         cflags_raytrace = env['CCFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
82         cxxflags_raytrace = env['CXXFLAGS'] +  env['BF_RAYOPTIMIZATION_SSE_FLAGS']
83
84 if env['OURPLATFORM'] == 'linuxcross':
85     if env['WITH_BF_RAYOPTIMIZATION']:
86         cflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
87         cxxflags_raytrace = env['CCFLAGS'] + env['BF_RAYOPTIMIZATION_SSE_FLAGS']
88
89 if env['WITH_BF_QUICKTIME']:
90     defs.append('WITH_QUICKTIME')
91     incs += ' ../quicktime ' + env['BF_QUICKTIME_INC']
92
93 if env['WITH_BF_OPENEXR']:
94     defs.append('WITH_OPENEXR')
95
96 if env['WITH_BF_FREESTYLE']:
97     incs += ' ../freestyle'
98     defs.append('WITH_FREESTYLE')
99
100 if env['WITH_BF_GAMEENGINE']:
101     defs.append('WITH_GAMEENGINE')
102
103 if env['WITH_BF_INTERNATIONAL']:
104     defs.append('WITH_INTERNATIONAL')
105
106 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
107     incs += ' ' + env['BF_PTHREADS_INC']
108
109 #
110 # HACK: To fix problem with error 'MMX instruction set not enabled' from mmintrin.h
111 #
112 if env['OURPLATFORM'] == 'linuxcross':
113     defs.append('__SSE__')
114     defs_raytrace.append('__MMX__')
115
116 if env['WITH_BF_RAYOPTIMIZATION']:
117     defs.append('__SSE__')
118     defs_raytrace.append('__SSE__')
119
120 env.BlenderLib ( libname = 'bf_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=145 )
121 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 )