src/SConscript
author Radek Brich <radek.brich@devl.cz>
Tue, 26 Jul 2016 18:19:37 +0200
branchpyrit
changeset 104 2274a07510c1
parent 101 50a994a57849
permissions -rw-r--r--
Cleanup, dropped Windows support
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
     1
Import('env pyenv buildmodule cc')
60
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
sources = [
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
     4
	'common.cc', 'raytracer.cc', 'sampler.cc', 'scene.cc',
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
     5
	'shapes.cc', 'material.cc', 'pixmap.cc', 'serialize.cc',
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
     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: 99
diff 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: 99
diff 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: 99
diff 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: 99
diff 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: 99
diff 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: 99
diff 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: 99
diff changeset
    13
	'simd.h', 'vector.h']
60
a23b5089b9c3 moving to SCons build system
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    15
if buildmodule:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    16
	shared_objs = []
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    17
	for src in sources:
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    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: 91
diff changeset
    19
	if cc == 'gcc':
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    20
		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
    21
	else:
9af5c039b678 add MSVC compiler support, make it default for Windows
Radek Brich <radek.brich@devl.cz>
parents: 91
diff changeset
    22
		ccflags = '$CCFLAGS'
104
2274a07510c1 Cleanup, dropped Windows support
Radek Brich <radek.brich@devl.cz>
parents: 101
diff changeset
    23
	linkflags = '$LINKFLAGS'
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    24
	pymodule = pyenv.SharedLibrary('pyrit',
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    25
		['raytracermodule.cc']+shared_objs,
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    26
		SHLIBPREFIX = '', CCFLAGS = ccflags,
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    27
		LINKFLAGS=linkflags)
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    28
	env.Alias('shared-objs', shared_objs)
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    29
	env.Alias('python-module', pymodule)
101
50a994a57849 vcproj build target only for cc=msvc, fix sdl-config
Radek Brich <radek.brich@devl.cz>
parents: 100
diff changeset
    30
	Return('pymodule')
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    31
else:
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    32
	objs = []
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    33
	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: 93
diff changeset
    34
		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: 93
diff changeset
    35
		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: 93
diff changeset
    36
		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: 93
diff changeset
    37
			env.Depends(o, '#build/include/config.h')
93
96d65f841791 more build script tuning
Radek Brich <radek.brich@devl.cz>
parents: 92
diff changeset
    38
	lib = env.StaticLibrary('pyrit', objs)
91
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    39
	env.Alias('objs', objs)
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    40
	env.Alias('static-lib', lib)
9d66d323c354 packetize Phong shader
Radek Brich <radek.brich@devl.cz>
parents: 90
diff changeset
    41
	Return('lib')