| author | Radek Brich <radek.brich@devl.cz> | 
| Thu, 15 May 2008 00:07:25 +0200 | |
| branch | pyrit | 
| changeset 96 | 9eb71e76c7fd | 
| parent 93 | 96d65f841791 | 
| child 99 | f3abdaa2e8fb | 
| permissions | -rw-r--r-- | 
| 93 | 1  | 
Import('env pyenv buildmodule cc')
 | 
| 60 | 2  | 
|
3  | 
sources = [  | 
|
| 93 | 4  | 
'common.cc', 'raytracer.cc', 'sampler.cc', 'scene.cc',  | 
5  | 
'shapes.cc', 'material.cc', 'pixmap.cc', 'serialize.cc',  | 
|
6  | 
'container.cc', 'kdtree.cc', 'octree.cc']  | 
|
| 60 | 7  | 
|
| 91 | 8  | 
if buildmodule:  | 
| 93 | 9  | 
shared_objs = []  | 
10  | 
for src in sources:  | 
|
11  | 
shared_objs.append( pyenv.SharedObject(src) )  | 
|
| 
92
 
9af5c039b678
add MSVC compiler support, make it default for Windows
 
Radek Brich <radek.brich@devl.cz> 
parents: 
91 
diff
changeset
 | 
12  | 
if cc == 'gcc':  | 
| 
 
9af5c039b678
add MSVC compiler support, make it default for Windows
 
Radek Brich <radek.brich@devl.cz> 
parents: 
91 
diff
changeset
 | 
13  | 
ccflags = '$CCFLAGS -Wno-write-strings'  | 
| 
 
9af5c039b678
add MSVC compiler support, make it default for Windows
 
Radek Brich <radek.brich@devl.cz> 
parents: 
91 
diff
changeset
 | 
14  | 
else:  | 
| 
 
9af5c039b678
add MSVC compiler support, make it default for Windows
 
Radek Brich <radek.brich@devl.cz> 
parents: 
91 
diff
changeset
 | 
15  | 
ccflags = '$CCFLAGS'  | 
| 93 | 16  | 
if cc == 'msvc':  | 
17  | 
linkflags = '$LINKFLAGS /export:initpyrit'  | 
|
18  | 
else:  | 
|
19  | 
linkflags = '$LINKFLAGS'  | 
|
| 91 | 20  | 
	pymodule = pyenv.SharedLibrary('pyrit',
 | 
21  | 
['raytracermodule.cc']+shared_objs,  | 
|
| 93 | 22  | 
SHLIBPREFIX = '', CCFLAGS = ccflags,  | 
23  | 
LINKFLAGS=linkflags)  | 
|
24  | 
if cc == 'msvc':  | 
|
25  | 
		pyenv.AddPostAction(pymodule, 'mt /nologo /manifest ${TARGET}.manifest /outputresource:$TARGET;2')
 | 
|
| 91 | 26  | 
	env.Alias('shared-objs', shared_objs)
 | 
27  | 
	env.Alias('python-module', pymodule)
 | 
|
28  | 
	Return('pymodule')
 | 
|
29  | 
else:  | 
|
| 93 | 30  | 
objs = []  | 
31  | 
for src in sources:  | 
|
32  | 
objs.append( env.Object(src) )  | 
|
33  | 
	lib = env.StaticLibrary('pyrit', objs)
 | 
|
| 91 | 34  | 
	env.Alias('objs', objs)
 | 
35  | 
	env.Alias('static-lib', lib)
 | 
|
36  | 
	Return('lib')
 |