src/SConscript
branchpyrit
changeset 100 c005054bf4c1
parent 99 f3abdaa2e8fb
child 101 50a994a57849
equal deleted inserted replaced
99:f3abdaa2e8fb 100:c005054bf4c1
     2 
     2 
     3 sources = [
     3 sources = [
     4 	'common.cc', 'raytracer.cc', 'sampler.cc', 'scene.cc',
     4 	'common.cc', 'raytracer.cc', 'sampler.cc', 'scene.cc',
     5 	'shapes.cc', 'material.cc', 'pixmap.cc', 'serialize.cc',
     5 	'shapes.cc', 'material.cc', 'pixmap.cc', 'serialize.cc',
     6 	'container.cc', 'kdtree.cc', 'octree.cc']
     6 	'container.cc', 'kdtree.cc', 'octree.cc']
       
     7 	
       
     8 includes = [
       
     9 	'common.h', 'container.h', 'kdtree.h', 'material.h',
       
    10 	'matrix.h', 'mempool.h', 'octree.h', 'pixmap.h',
       
    11 	'quaternion.h', 'raytracer.h', 'raytracermodule.h',
       
    12 	'sampler.h', 'scene.h',	'serialize.h', 'shapes.h',
       
    13 	'simd.h', 'vector.h']
     7 
    14 
     8 if buildmodule:
    15 if buildmodule:
     9 	shared_objs = []
    16 	shared_objs = []
    10 	for src in sources:
    17 	for src in sources:
    11 		shared_objs.append( pyenv.SharedObject(src) )
    18 		shared_objs.append( pyenv.SharedObject(src) )
    23 		LINKFLAGS=linkflags)
    30 		LINKFLAGS=linkflags)
    24 	if cc == 'msvc':	
    31 	if cc == 'msvc':	
    25 		pyenv.AddPostAction(pymodule, 'mt /nologo /manifest ${TARGET}.manifest /outputresource:$TARGET;2')
    32 		pyenv.AddPostAction(pymodule, 'mt /nologo /manifest ${TARGET}.manifest /outputresource:$TARGET;2')
    26 	env.Alias('shared-objs', shared_objs)
    33 	env.Alias('shared-objs', shared_objs)
    27 	env.Alias('python-module', pymodule)
    34 	env.Alias('python-module', pymodule)
    28 	Return('pymodule')
    35 	
       
    36 	# MS Visual Studio Project
       
    37 	vcprojsrcs = []
       
    38 	for src in sources+['raytracermodule.cc']:
       
    39 		vcprojsrcs += ['src/' + src]
       
    40 	vcprojincs = []
       
    41 	for inc in includes:
       
    42 		vcprojincs += ['include/' + inc]
       
    43 	vcproj = env.MSVSProject(
       
    44 		auto_build_solution=0,
       
    45 		target = '#pyrit_module' + env['MSVSPROJECTSUFFIX'],
       
    46 		srcs = vcprojsrcs,
       
    47 		incs = vcprojincs,
       
    48 		buildtarget = 'python-module',
       
    49 		variant = 'Release')
       
    50 	
       
    51 	Return(('pymodule', 'vcproj'))
    29 else:
    52 else:
    30 	objs = []
    53 	objs = []
    31 	for src in sources:
    54 	for src in sources:
    32 		o = env.Object(src)
    55 		o = env.Object(src)
    33 		objs.append( o )
    56 		objs.append( o )