=== SCons ===
[blender.git] / source / blender / makesrna / intern / SConscript
1 #!/usr/bin/python
2 import sys
3 import os
4
5 Import ('env')
6 cflags = ''
7 defines = []
8 root_build_dir=env['BF_BUILDDIR']
9
10 source_files = env.Glob('*.c')
11
12 # making rna_access.c part of both makesrna and blender seems to
13 # give conflict, how to solve?
14 source_files.remove('rna_access.c')
15 source_files.remove('rna_dependency.c')
16
17 makesrna_tool = env.Clone()
18 rna = env.Clone()
19 makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" ')
20
21 makesrna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
22                                  '../../blenlib',
23                                  '../../blenkernel',
24                                  '../../makesdna',
25                                  '../../makesrna'])
26
27 if env['OURPLATFORM'] == 'linuxcross':
28     makesrna_tool.Replace(CC='gcc')
29     makesrna_tool.Replace(AR='ar')
30     makesrna_tool.Replace(LINK='gcc')
31
32 if sys.platform != 'cygwin':
33     makesrna_tool.Append (CCFLAGS = cflags)
34 makesrna_tool.Append (CPPDEFINES = defines)
35 makesrna_tool.Append (LIBPATH = '#'+root_build_dir+'/lib')
36 if env['BF_PROFILE']:
37         makesrna_tool.Append (LINKFLAGS = env['BF_PROFILE_FLAGS'])
38
39 if env['OURPLATFORM'] == 'linux2' and root_build_dir[0]==os.sep:
40     makesrna = makesrna_tool.Program (target = root_build_dir+'/makesrna', source = source_files, LIBS=['bf_guardedalloc', 'bf_dna'])
41 else:
42     makesrna = makesrna_tool.Program (target = '#'+root_build_dir+'/makesrna', source = source_files, LIBS=['bf_guardedalloc', 'bf_dna'])
43
44 rna_dict = rna.Dictionary()
45 rna.Depends ('rna.c', makesrna)
46 if env['OURPLATFORM'] != 'linuxcross':
47     rna.Command ('rna.c', '', root_build_dir+os.sep+"makesrna $TARGET")
48 else:
49     rna.Command ('rna.c', '', root_build_dir+os.sep+"makesrna.exe $TARGET")
50 obj = ['intern/rna.c', 'intern/rna_access.c', 'intern/rna_dependency.c']
51 Return ('obj')
52