1 Import('env buildmodule') |
1 Import('env buildmodule cc') |
2 |
2 |
3 env = env.Clone(CPPPATH = '#include') |
3 myenv = env.Clone(CPPPATH = '#include') |
4 pyenv = env.Clone() |
4 pyenv = myenv.Clone() |
5 if env['PLATFORM'] == 'win32': |
5 if env['PLATFORM'] == 'win32': |
6 import sys |
6 import sys |
7 pythonver = '%c%c' % (sys.version[0], sys.version[2]) |
7 pythonver = '%c%c' % (sys.version[0], sys.version[2]) |
8 pythonlib = 'python'+pythonver |
8 pythonlib = 'python'+pythonver |
9 pythonpath = [env['pythonpath'], |
9 pythonpath = [env['pythonpath'], |
21 'serialize.cc', 'pixmap.cc'] |
21 'serialize.cc', 'pixmap.cc'] |
22 |
22 |
23 objs = [] |
23 objs = [] |
24 shared_objs = [] |
24 shared_objs = [] |
25 for src in sources: |
25 for src in sources: |
26 objs.append( env.Object(src) ) |
26 objs.append( myenv.Object(src) ) |
27 shared_objs.append( env.SharedObject(src) ) |
27 shared_objs.append( myenv.SharedObject(src) ) |
28 |
28 |
29 if buildmodule: |
29 if buildmodule: |
|
30 if cc == 'gcc': |
|
31 ccflags = '$CCFLAGS -Wno-write-strings' |
|
32 else: |
|
33 ccflags = '$CCFLAGS' |
30 pymodule = pyenv.SharedLibrary('pyrit', |
34 pymodule = pyenv.SharedLibrary('pyrit', |
31 ['raytracermodule.cc']+shared_objs, |
35 ['raytracermodule.cc']+shared_objs, |
32 SHLIBPREFIX = '', |
36 SHLIBPREFIX = '', CCFLAGS = ccflags) |
33 CCFLAGS = '$CCFLAGS -Wno-write-strings') |
|
34 env.Alias('shared-objs', shared_objs) |
37 env.Alias('shared-objs', shared_objs) |
35 env.Alias('python-module', pymodule) |
38 env.Alias('python-module', pymodule) |
36 Return('pymodule') |
39 Return('pymodule') |
37 else: |
40 else: |
38 lib = env.StaticLibrary('pyrit', objs) |
41 lib = myenv.StaticLibrary('pyrit', objs) |
39 env.Alias('objs', objs) |
42 env.Alias('objs', objs) |
40 env.Alias('static-lib', lib) |
43 env.Alias('static-lib', lib) |
41 Return('lib') |
44 Return('lib') |