1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
import sys
# Import the C flags set in the SConstruct file
Import ('cflags')
Import ('defines')
Import ('platform_libs')
Import ('platform_libpath')
Import ('platform_linkflags')
Import ('user_options_dict')
if sys.platform=='win32':
platform_linkflags = ['/SUBSYSTEM:CONSOLE',
'/MACHINE:I386',
'/ENTRY:mainCRTStartup',
'/NODEFAULTLIB:"msvcprt.lib"',
'/NODEFAULTLIB:"glut32.lib"',
'/NODEFAULTLIB:"libcd.lib"',
#'/NODEFAULTLIB:"libc.lib"',
'/NODEFAULTLIB:"libcpd.lib"',
'/NODEFAULTLIB:"libcp.lib"',
'/NODEFAULTLIB:"libcmtd.lib"'
]
# TODO: make sure the makesdna program does not get installed on the system.
source_files = ['makesdna.c']
makesdna_tool = Environment (CCFLAGS='-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
'..'])
makesdna_tool.Replace (CC = user_options_dict['HOST_CC'])
makesdna_tool.Replace (PATH = user_options_dict['PATH'])
makesdna_tool.Append (CCFLAGS = cflags)
makesdna_tool.Append (CPPDEFINES = defines)
makesdna_tool.Append (LINKFLAGS = platform_linkflags)
makesdna_tool.Append (LIBPATH = '#'+user_options_dict['BUILD_DIR']+'/lib')
makesdna_tool.Append (LIBS = 'blender_guardedalloc')
makesdna_tool.Program (target = '#'+user_options_dict['BUILD_DIR']+'makesdna', source = source_files)
dna = Environment ()
dna_dict = dna.Dictionary()
makesdna_name = user_options_dict['BUILD_DIR']+'makesdna' + dna_dict['PROGSUFFIX']
dna.Depends ('dna.c', '#'+makesdna_name)
dna.Command ('dna.c', '', user_options_dict['BUILD_DIR']+"makesdna $TARGET")
obj = 'intern/dna.c'
Return ('obj')
|