src/SConscript
branchpyrit
changeset 65 242839c6d27d
parent 63 440e1ae80459
child 78 9569e9f35374
--- a/src/SConscript	Wed Apr 09 17:55:29 2008 +0200
+++ b/src/SConscript	Thu Apr 10 23:20:36 2008 +0200
@@ -1,11 +1,19 @@
 Import('env')
 env.Append(CPPPATH = '#include')
 
-import os
-PY_CCFLAGS = os.popen('python-config --includes').read()
-PY_LDFLAGS = os.popen('python-config --libs').read()
 pyenv = env.Clone()
-pyenv.Append(LINKFLAGS=PY_LDFLAGS, CCFLAGS=PY_CCFLAGS)
+if env['PLATFORM'] == 'win32':
+	import sys
+	pythonver = '%c%c' % (sys.version[0], sys.version[2])
+	pythonlib = 'python'+pythonver
+	pythonpath = [env['pythonpath'],
+		'C:\\Program Files\\Python'+pythonver]
+	pyenv.Append(LIBS=pythonlib)
+	pyenv.Append(CPPPATH=[s+'\\include' for s in pythonpath])
+	pyenv.Append(LIBPATH=[s+'\\libs' for s in pythonpath])
+	pyenv.Replace(SHLIBSUFFIX='.pyd')
+else:
+	pyenv.ParseConfig('python-config --includes --libs')
 
 sources = [
 	'raytracer.cc', 'scene.cc', 'sampler.cc',
@@ -17,7 +25,7 @@
 	objs.append( env.Object(src) )
 	shared_objs.append( env.SharedObject(src) )
 
-pymodule = pyenv.SharedLibrary(
+pymodule = pyenv.SharedLibrary('raytracer',
 	['raytracermodule.cc']+shared_objs,
 	SHLIBPREFIX = '',
 	CCFLAGS = '$CCFLAGS -Wno-write-strings')