editmesh accessor functions. most editmesh access now goes through:
[blender.git] / source / blender / makesrna / intern / SConscript
1 #!/usr/bin/python
2 import sys
3 import os
4
5 def normpath(path):
6         return os.path.abspath(os.path.normpath(path))
7
8 Import ('env')
9 cflags = '-Wall'
10 defines = []
11 root_build_dir=normpath(env['BF_BUILDDIR'])
12
13 source_files = env.Glob('*.c')
14
15 # making rna_access.c part of both makesrna and blender seems to
16 # give conflict, how to solve?
17 source_files.remove('rna_access.c')
18
19 generated_files = source_files[:]
20 generated_files.remove('rna_define.c')
21 generated_files.remove('makesrna.c')
22
23 generated_files = [filename[:-2] + '_gen.c' for filename in generated_files]
24
25 makesrna_tool = env.Clone()
26 rna = env.Clone()
27 makesrna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesrna/\\"" ')
28
29 makesrna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
30                                  '../../blenlib',
31                                  '../../blenkernel',
32                                  '../../makesdna',
33                                  '../../makesrna',
34                                                                  '../../windowmanager'])
35
36 if env['OURPLATFORM'] == 'linuxcross':
37         USE_WINE = True # when cross compiling on linux 64bit this is useful
38 else:
39         USE_WINE = False
40
41 if not USE_WINE:
42         if env['OURPLATFORM'] == 'linuxcross':
43                 makesdna_tool.Replace(CC='gcc')
44                 makesdna_tool.Replace(AR='ar')
45                 makesdna_tool.Replace(LINK='gcc')
46
47 if sys.platform != 'cygwin':
48     makesrna_tool.Append (CCFLAGS = cflags)
49 makesrna_tool.Append (CPPDEFINES = defines)
50
51 libdir = root_build_dir+'/lib'
52 if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
53         libdir = '#' + libdir
54
55 makesrna_tool.Append (LIBPATH = libdir)
56
57 if env['BF_PROFILE']:
58         makesrna_tool.Append (LINKFLAGS = env['BF_PROFILE_FLAGS'])
59
60 if env['BF_DEBUG']:
61         makesrna_tool.Append(CFLAGS = env['BF_DEBUG_CFLAGS'])
62         makesrna_tool.Append(CCFLAGS = env['BF_DEBUG_CCFLAGS'])
63         if env['OURPLATFORM'] == 'win32-vc':
64                 makesrna_tool.Append(LINKFLAGS = ['/DEBUG','/PDB:makesrna.pdb'])
65
66 targetpath = root_build_dir+'/makesrna'
67 if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'):
68         targetpath = '#' + targetpath
69
70 if env['OURPLATFORM'] == 'linux2' and root_build_dir[0]==os.sep:
71     makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_guardedalloc', 'bf_dna'])
72 else:
73     makesrna = makesrna_tool.Program (target = targetpath, source = source_files, LIBS=['bf_guardedalloc', 'bf_dna'])
74
75 rna_dict = rna.Dictionary()
76 rna.Depends (generated_files, makesrna)
77
78 # this seems bad, how to retrieve it from scons?
79 build_dir = root_build_dir + '/source/blender/makesrna/intern/'
80
81 if env['OURPLATFORM'] != 'linuxcross':
82     rna.Command (generated_files, '', root_build_dir+os.sep+"makesrna " + build_dir)
83 else:
84     rna.Command (generated_files, '', root_build_dir+os.sep+"makesrna.exe "  + build_dir)
85         
86     if USE_WINE:
87         rna.Command (generated_files, '', 'wine ' + root_build_dir+os.sep+"makesrna.exe "  + build_dir)
88     else:
89         rna.Command (generated_files, '', root_build_dir+os.sep+"makesrna.exe "  + build_dir)
90
91
92 obj = ['intern/rna_access.c']
93 for generated_file in generated_files:
94         obj += ['intern/' + generated_file]
95
96 Return ('obj')
97