18 shared_objs.append( pyenv.SharedObject(src) ) |
18 shared_objs.append( pyenv.SharedObject(src) ) |
19 if cc == 'gcc': |
19 if cc == 'gcc': |
20 ccflags = '$CCFLAGS -Wno-write-strings' |
20 ccflags = '$CCFLAGS -Wno-write-strings' |
21 else: |
21 else: |
22 ccflags = '$CCFLAGS' |
22 ccflags = '$CCFLAGS' |
23 if cc == 'msvc': |
23 linkflags = '$LINKFLAGS' |
24 linkflags = '$LINKFLAGS /export:initpyrit' |
|
25 else: |
|
26 linkflags = '$LINKFLAGS' |
|
27 pymodule = pyenv.SharedLibrary('pyrit', |
24 pymodule = pyenv.SharedLibrary('pyrit', |
28 ['raytracermodule.cc']+shared_objs, |
25 ['raytracermodule.cc']+shared_objs, |
29 SHLIBPREFIX = '', CCFLAGS = ccflags, |
26 SHLIBPREFIX = '', CCFLAGS = ccflags, |
30 LINKFLAGS=linkflags) |
27 LINKFLAGS=linkflags) |
31 if cc == 'msvc': |
|
32 pyenv.AddPostAction(pymodule, 'mt /nologo /manifest ${TARGET}.manifest /outputresource:$TARGET;2') |
|
33 env.Alias('shared-objs', shared_objs) |
28 env.Alias('shared-objs', shared_objs) |
34 env.Alias('python-module', pymodule) |
29 env.Alias('python-module', pymodule) |
35 |
|
36 if cc == 'msvc': |
|
37 # MS Visual Studio Project |
|
38 vcprojsrcs = [] |
|
39 for src in sources+['raytracermodule.cc']: |
|
40 vcprojsrcs += ['src/' + src] |
|
41 vcprojincs = [] |
|
42 for inc in includes: |
|
43 vcprojincs += ['include/' + inc] |
|
44 vcproj = env.MSVSProject( |
|
45 auto_build_solution=0, |
|
46 target = '#pyrit_module' + env['MSVSPROJECTSUFFIX'], |
|
47 srcs = vcprojsrcs, |
|
48 incs = vcprojincs, |
|
49 buildtarget = 'python-module', |
|
50 variant = 'Release') |
|
51 Return(('pymodule', 'vcproj')) |
|
52 |
|
53 Return('pymodule') |
30 Return('pymodule') |
54 else: |
31 else: |
55 objs = [] |
32 objs = [] |
56 for src in sources: |
33 for src in sources: |
57 o = env.Object(src) |
34 o = env.Object(src) |