src/SConscript
author Radek Brich <radek.brich@devl.cz>
Mon, 05 May 2008 15:31:14 +0200
branchpyrit
changeset 92 9af5c039b678
parent 91 9d66d323c354
child 93 96d65f841791
permissions -rw-r--r--
add MSVC compiler support, make it default for Windows new header file simd.h for SSE abstraction and helpers add mselect pseudo instruction for common or(and(...), andnot(...)) replace many SSE intrinsics with new names new MemoryPool class (mempool.h) for faster KdNode allocation remove setMaxDepth() from Octree and KdTree, make max_depth const, it should be defined in constructor and never changed, change after building tree would cause error in traversal modify DefaultSampler to generate nice 2x2 packets of samples for packet tracing optimize Box and BBox::intersect_packet add precomputed invdir attribute to RayPacket scons build system: check for pthread library on Windows check for SDL generate include/config.h with variables detected by scons configuration move auxiliary files to build/ add sanity checks add writable operator[] to Vector
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
     1
Import('env buildmodule cc')
60
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
     3
myenv = env.Clone(CPPPATH = '#include')
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
     4
pyenv = myenv.Clone()
65
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
     5
if env['PLATFORM'] == 'win32':
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
     6
	import sys
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
     7
	pythonver = '%c%c' % (sys.version[0], sys.version[2])
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
     8
	pythonlib = 'python'+pythonver
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
     9
	pythonpath = [env['pythonpath'],
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
    10
		'C:\\Program Files\\Python'+pythonver]
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
    11
	pyenv.Append(LIBS=pythonlib)
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
    12
	pyenv.Append(CPPPATH=[s+'\\include' for s in pythonpath])
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
    13
	pyenv.Append(LIBPATH=[s+'\\libs' for s in pythonpath])
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
    14
	pyenv.Replace(SHLIBSUFFIX='.pyd')
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
    15
else:
242839c6d27d basic detection of compiler (GCC or ICC) and CPU capabilities
Radek Brich <radek.brich@devl.cz>
parents: 63
diff changeset
    16
	pyenv.ParseConfig('python-config --includes --libs')
60
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    17
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    18
sources = [
78
9569e9f35374 move shapes to extra source file
Radek Brich <radek.brich@devl.cz>
parents: 65
diff changeset
    19
	'raytracer.cc', 'scene.cc', 'shapes.cc', 'sampler.cc',
79
062b1c4143f7 material and texture classes moved to material.(cc,h)
Radek Brich <radek.brich@devl.cz>
parents: 78
diff changeset
    20
	'container.cc', 'kdtree.cc', 'octree.cc', 'material.cc',
88
f7edb3b90816 merge pixmap handling from sampler, material.h and ccdemos's image module to new Pixmap class
Radek Brich <radek.brich@devl.cz>
parents: 79
diff changeset
    21
	'serialize.cc', 'pixmap.cc']
60
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    22
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    23
objs = []
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    24
shared_objs = []
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    25
for src in sources:
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    26
	objs.append( myenv.Object(src) )
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    27
	shared_objs.append( myenv.SharedObject(src) )
60
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    28
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    29
if buildmodule:
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    30
	if cc == 'gcc':
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    31
		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
    32
	else:
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    33
		ccflags = '$CCFLAGS'
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    34
	pymodule = pyenv.SharedLibrary('pyrit',
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    35
		['raytracermodule.cc']+shared_objs,
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    36
		SHLIBPREFIX = '', CCFLAGS = ccflags)
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    37
	env.Alias('shared-objs', shared_objs)
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    38
	env.Alias('python-module', pymodule)
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    39
	Return('pymodule')
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    40
else:
92
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    41
	lib = myenv.StaticLibrary('pyrit', objs)
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    42
	env.Alias('objs', objs)
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    43
	env.Alias('static-lib', lib)
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    44
	Return('lib')