src/SConscript
author Radek Brich <radek.brich@devl.cz>
Thu, 08 May 2008 09:21:25 +0200
branchpyrit
changeset 94 4c8abb8977dc
parent 93 96d65f841791
child 99 f3abdaa2e8fb
permissions -rw-r--r--
update README update Doxygen docs scons option 'msvc' changed to 'mingw' as msvc is default and mingw must be turned on explicitly

Import('env pyenv buildmodule cc')

sources = [
	'common.cc', 'raytracer.cc', 'sampler.cc', 'scene.cc',
	'shapes.cc', 'material.cc', 'pixmap.cc', 'serialize.cc',
	'container.cc', 'kdtree.cc', 'octree.cc']

if buildmodule:
	shared_objs = []
	for src in sources:
		shared_objs.append( pyenv.SharedObject(src) )
	if cc == 'gcc':
		ccflags = '$CCFLAGS -Wno-write-strings'
	else:
		ccflags = '$CCFLAGS'
	if cc == 'msvc':
		linkflags = '$LINKFLAGS /export:initpyrit'
	else:
		linkflags = '$LINKFLAGS'
	pymodule = pyenv.SharedLibrary('pyrit',
		['raytracermodule.cc']+shared_objs,
		SHLIBPREFIX = '', CCFLAGS = ccflags,
		LINKFLAGS=linkflags)
	if cc == 'msvc':	
		pyenv.AddPostAction(pymodule, 'mt /nologo /manifest ${TARGET}.manifest /outputresource:$TARGET;2')
	env.Alias('shared-objs', shared_objs)
	env.Alias('python-module', pymodule)
	Return('pymodule')
else:
	objs = []
	for src in sources:
		objs.append( env.Object(src) )
	lib = env.StaticLibrary('pyrit', objs)
	env.Alias('objs', objs)
	env.Alias('static-lib', lib)
	Return('lib')