* tweak linking priorities - should help for GCC users
[blender.git] / source / blender / makesdna / 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 = ['makesdna.c']
11
12 makesdna_tool = env.Copy()
13 dna = env.Copy()
14 makesdna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
15
16 makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
17                                                                  '../../makesdna'])
18
19 if env['OURPLATFORM'] == 'linuxcross':
20         makesdna_tool.Replace(CC='gcc')
21         makesdna_tool.Replace(AR='ar')
22         makesdna_tool.Replace(LINK='gcc')
23
24 if sys.platform != 'cygwin':
25         makesdna_tool.Append (CCFLAGS = cflags)
26 makesdna_tool.Append (CPPDEFINES = defines)
27 makesdna_tool.Append (LIBPATH = '#'+root_build_dir+'/lib')
28
29 if env['OURPLATFORM'] == 'linux2' and root_build_dir[0]==os.sep:
30         makesdna = makesdna_tool.Program (target = root_build_dir+'/makesdna', source = source_files, LIBS=['bf_guardedalloc'])
31 else:
32         makesdna = makesdna_tool.Program (target = '#'+root_build_dir+'/makesdna', source = source_files, LIBS=['bf_guardedalloc'])
33
34 dna_dict = dna.Dictionary()
35 dna.Depends ('dna.c', makesdna)
36 if env['OURPLATFORM'] != 'linuxcross':
37         dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna $TARGET")
38 else:
39         dna.Command ('dna.c', '', root_build_dir+os.sep+"makesdna.exe $TARGET")
40 obj = 'intern/dna.c'
41 Return ('obj')