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