1 Import('env') |
1 Import('env buildmodule') |
2 env.Append(CPPPATH = '#include') |
|
3 |
2 |
|
3 env = env.Clone(CPPPATH = '#include') |
4 pyenv = env.Clone() |
4 pyenv = env.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 |
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( env.Object(src) ) |
27 shared_objs.append( env.SharedObject(src) ) |
27 shared_objs.append( env.SharedObject(src) ) |
28 |
28 |
29 pymodule = pyenv.SharedLibrary('pyrit', |
29 if buildmodule: |
30 ['raytracermodule.cc']+shared_objs, |
30 pymodule = pyenv.SharedLibrary('pyrit', |
31 SHLIBPREFIX = '', |
31 ['raytracermodule.cc']+shared_objs, |
32 CCFLAGS = '$CCFLAGS -Wno-write-strings') |
32 SHLIBPREFIX = '', |
33 |
33 CCFLAGS = '$CCFLAGS -Wno-write-strings') |
34 lib = env.StaticLibrary('pyrit', objs) |
34 env.Alias('shared-objs', shared_objs) |
35 |
35 env.Alias('python-module', pymodule) |
36 env.Alias('objs', objs) |
36 Return('pymodule') |
37 env.Alias('static-lib', lib) |
37 else: |
38 env.Alias('shared-objs', shared_objs) |
38 lib = env.StaticLibrary('pyrit', objs) |
39 env.Alias('python-module', pymodule) |
39 env.Alias('objs', objs) |
40 env.Alias('libs', ['static-lib', 'python-module']) |
40 env.Alias('static-lib', lib) |
41 |
41 Return('lib') |
42 Return('lib pymodule') |
|