| author | Radek Brich <radek.brich@devl.cz> | 
| Sun, 31 May 2009 23:06:03 +0200 | |
| branch | pyrit | 
| changeset 100 | c005054bf4c1 | 
| parent 99 | f3abdaa2e8fb | 
| child 101 | 50a994a57849 | 
| 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'] | |
| 100 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 7 | |
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 8 | includes = [ | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 9 | 'common.h', 'container.h', 'kdtree.h', 'material.h', | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 10 | 'matrix.h', 'mempool.h', 'octree.h', 'pixmap.h', | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 11 | 'quaternion.h', 'raytracer.h', 'raytracermodule.h', | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 12 | 'sampler.h', 'scene.h', 'serialize.h', 'shapes.h', | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 13 | 'simd.h', 'vector.h'] | 
| 60 | 14 | |
| 91 | 15 | if buildmodule: | 
| 93 | 16 | shared_objs = [] | 
| 17 | for src in sources: | |
| 18 | shared_objs.append( pyenv.SharedObject(src) ) | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 19 | if cc == 'gcc': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 20 | ccflags = '$CCFLAGS -Wno-write-strings' | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 21 | else: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 22 | ccflags = '$CCFLAGS' | 
| 93 | 23 | if cc == 'msvc': | 
| 24 | linkflags = '$LINKFLAGS /export:initpyrit' | |
| 25 | else: | |
| 26 | linkflags = '$LINKFLAGS' | |
| 91 | 27 | 	pymodule = pyenv.SharedLibrary('pyrit',
 | 
| 28 | ['raytracermodule.cc']+shared_objs, | |
| 93 | 29 | SHLIBPREFIX = '', CCFLAGS = ccflags, | 
| 30 | LINKFLAGS=linkflags) | |
| 31 | if cc == 'msvc': | |
| 32 | 		pyenv.AddPostAction(pymodule, 'mt /nologo /manifest ${TARGET}.manifest /outputresource:$TARGET;2')
 | |
| 91 | 33 | 	env.Alias('shared-objs', shared_objs)
 | 
| 34 | 	env.Alias('python-module', pymodule)
 | |
| 100 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 35 | |
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 36 | # MS Visual Studio Project | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 37 | vcprojsrcs = [] | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 38 | for src in sources+['raytracermodule.cc']: | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 39 | vcprojsrcs += ['src/' + src] | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 40 | vcprojincs = [] | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 41 | for inc in includes: | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 42 | vcprojincs += ['include/' + inc] | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 43 | vcproj = env.MSVSProject( | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 44 | auto_build_solution=0, | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 45 | target = '#pyrit_module' + env['MSVSPROJECTSUFFIX'], | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 46 | srcs = vcprojsrcs, | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 47 | incs = vcprojincs, | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 48 | buildtarget = 'python-module', | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 49 | variant = 'Release') | 
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 50 | |
| 
c005054bf4c1
new build target 'vcproj' - generate Visual C++ Studio project files; fix GCC warnings in intersect_packet()
 Radek Brich <radek.brich@devl.cz> parents: 
99diff
changeset | 51 | 	Return(('pymodule', 'vcproj'))
 | 
| 91 | 52 | else: | 
| 93 | 53 | objs = [] | 
| 54 | for src in sources: | |
| 99 
f3abdaa2e8fb
build script: updated for latest SCons, moved config.h to build/, help and clean targets does not run configure any more, fixed GCC check, added check for zlib
 Radek Brich <radek.brich@devl.cz> parents: 
93diff
changeset | 55 | o = env.Object(src) | 
| 
f3abdaa2e8fb
build script: updated for latest SCons, moved config.h to build/, help and clean targets does not run configure any more, fixed GCC check, added check for zlib
 Radek Brich <radek.brich@devl.cz> parents: 
93diff
changeset | 56 | objs.append( o ) | 
| 
f3abdaa2e8fb
build script: updated for latest SCons, moved config.h to build/, help and clean targets does not run configure any more, fixed GCC check, added check for zlib
 Radek Brich <radek.brich@devl.cz> parents: 
93diff
changeset | 57 | if src == 'common.cc' or src == 'pixmap.cc': | 
| 
f3abdaa2e8fb
build script: updated for latest SCons, moved config.h to build/, help and clean targets does not run configure any more, fixed GCC check, added check for zlib
 Radek Brich <radek.brich@devl.cz> parents: 
93diff
changeset | 58 | env.Depends(o, '#build/include/config.h') | 
| 93 | 59 | 	lib = env.StaticLibrary('pyrit', objs)
 | 
| 91 | 60 | 	env.Alias('objs', objs)
 | 
| 61 | 	env.Alias('static-lib', lib)
 | |
| 62 | 	Return('lib')
 |