| author | Radek Brich <radek.brich@devl.cz> | 
| Sat, 10 May 2008 14:29:37 +0200 | |
| branch | pyrit | 
| changeset 95 | ca7d4c665531 | 
| parent 94 | 4c8abb8977dc | 
| child 99 | f3abdaa2e8fb | 
| permissions | -rw-r--r-- | 
| 64 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 1 | Help("""
 | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 2 | Targets: | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 3 | all - build everything, | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 4 | |
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 5 | libs - build all libraries | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 6 | demos - build all demos | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 7 | models - download/prepare all models | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 8 | docs - compile doxygen documentation | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 9 | |
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 10 | libs = (static-lib, python-module) | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 11 | static-lib - ray tracer library to link with | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 12 | python-module - ray tracer module for Python | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 13 | |
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 14 | demos = (python-demos, cc-demos) | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 15 | python-demos - Python demos, this depends on python-module | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 16 | cc-demos - C++ demos | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 17 | |
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 18 | models = (local-models, download-models) | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 19 | local-models - prepare local models | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 20 | download-models - download models which are not locally available | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 21 | |
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 22 | no-docs = (libs, demos, models) | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 23 | - everything but docs | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 24 | no-download = (libs, demos, local-models) | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 25 | - everything but docs and downloadable models | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 26 | |
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 27 | Default target is no-download. | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 28 | |
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 29 | Options: | 
| 64 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 30 | """) | 
| 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 31 | |
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 32 | import os, sys | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 33 | |
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 34 | EnsurePythonVersion(2, 3) | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 35 | EnsureSConsVersion(0, 97) | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 36 | |
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 37 | Decider('MD5-timestamp')
 | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 38 | SConsignFile('build/.sconsign.dblite')
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 39 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 40 | if sys.platform == 'win32': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 41 | tools = ['mingw'] | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 42 | else: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 43 | tools = ['default'] | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 44 | |
| 93 | 45 | env = Environment(tools = tools, CPPPATH = ['.','#include']) | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 46 | |
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 47 | opt = Options(['build/.optioncache']) | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 48 | opt.AddOptions( | 
| 91 | 49 | 	BoolOption('simd', 'allow SSE intrinsics', True),
 | 
| 67 
249553e1d4fe
new option to choose single or double precision floats
 Radek Brich <radek.brich@devl.cz> parents: 
66diff
changeset | 50 | 	('precision', 'floating point number precision (single/double)', "single"),
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 51 | 	('flags', 'add additional compiler flags', ""),
 | 
| 91 | 52 | 	BoolOption('force_flags', "use only flags specified by 'flags' option (do not autodetect arch/sse flags)", False),
 | 
| 95 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 53 | 	('ldflags', 'add additional linker flags', ""),
 | 
| 91 | 54 | 	BoolOption('profile', "enable gcc's profiling support (-pg)", False),
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 55 | ) | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 56 | if env['PLATFORM'] == 'win32': | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 57 | opt.AddOptions( | 
| 94 | 58 | 		BoolOption('mingw', 'use Mingw and GCC compiler, if available', False),
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 59 | 		('pythonpath', 'path to Python installation',
 | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 60 | 'C:\\Python%c%c' % (sys.version[0], sys.version[2])), | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 61 | ) | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 62 | else: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 63 | opt.AddOptions( | 
| 94 | 64 | 		BoolOption('intelc', 'use Intel C++ Compiler, if available', False),
 | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 65 | ) | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 66 | |
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 67 | |
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 68 | opt.Update(env) | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 69 | opt.Save('build/.optioncache', env)
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 70 | Help(opt.GenerateHelpText(env)) | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 71 | |
| 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: 
85diff
changeset | 72 | |
| 
f7edb3b90816
merge pixmap handling from sampler, material.h and ccdemos's image module to new Pixmap class
 Radek Brich <radek.brich@devl.cz> parents: 
85diff
changeset | 73 | ### configure | 
| 
f7edb3b90816
merge pixmap handling from sampler, material.h and ccdemos's image module to new Pixmap class
 Radek Brich <radek.brich@devl.cz> parents: 
85diff
changeset | 74 | |
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 75 | platform = 'unknown' | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 76 | def CheckPlatform(context): | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 77 | global platform | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 78 | 	context.Message('Platform is... ')
 | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 79 | if sys.platform[:5] == 'linux': | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 80 | platform = 'linux' | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 81 | elif env['PLATFORM'] == 'posix': | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 82 | platform = 'posix' | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 83 | elif env['PLATFORM'] == 'win32': | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 84 | platform = 'win32' | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 85 | context.Result(platform) | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 86 | return True | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 87 | |
| 93 | 88 | intelcversion = '' | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 89 | def CheckIntelC(context): | 
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 90 | global intelc, intelcversion | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 91 | 	context.Message('Checking for IntelC compiler... ')
 | 
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 92 | 	intelc = Tool("intelc").exists(env) == True
 | 
| 66 | 93 | if intelc: | 
| 94 | testenv = Environment() | |
| 95 | 		Tool("intelc").generate(testenv)
 | |
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 96 | intelcversion = str(testenv['INTEL_C_COMPILER_VERSION']/10.) | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 97 | context.Result(intelcversion) | 
| 66 | 98 | else: | 
| 99 | context.Result(intelc) | |
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 100 | return intelc | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 101 | |
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 102 | def CheckGCC(context): | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 103 | global gcc, gccversion | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 104 | 	context.Message('Checking for GCC compiler... ')
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 105 | gcc = "g++" in env['TOOLS'] | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 106 | if gcc: | 
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 107 | gccversion = env['CCVERSION'] | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 108 | context.Result(gccversion) | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 109 | else: | 
| 70 
4b84e90325c5
a fix for CPU and compiler detection
 Radek Brich <radek.brich@devl.cz> parents: 
68diff
changeset | 110 | gccversion = '' | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 111 | context.Result(False) | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 112 | return gcc | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 113 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 114 | def CheckMSVC(context): | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 115 | global msvc, msvcversion | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 116 | 	context.Message('Checking for MSVC compiler... ')
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 117 | testenv = Environment() | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 118 | msvc = "msvc" in testenv['TOOLS'] | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 119 | if msvc: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 120 | msvcversion = testenv['MSVS_VERSION'] | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 121 | context.Result(msvcversion) | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 122 | else: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 123 | msvcversion = '' | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 124 | context.Result(False) | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 125 | return msvc | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 126 | |
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 127 | def CheckCPUFlags(context): | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 128 | global cpu, cpuflags_gcc, cpuflags_intelc | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 129 | 	context.Message('Checking CPU arch and flags... ')
 | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 130 | 	env.Execute('@$CC tools/cpuflags.c -o tools/cpuflags')
 | 
| 85 
907a634e5c02
implement triangle packet intersection
 Radek Brich <radek.brich@devl.cz> parents: 
84diff
changeset | 131 | 	(cpu, cpuflags_gcc, cpuflags_intelc) = os.popen('tools'+os.sep+'cpuflags %s %s'
 | 
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 132 | 		% (''.join(gccversion.rsplit('.',1)), intelcversion) ).read().split('\n')[:3]
 | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 133 | context.Result(cpu) | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 134 | return True | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 135 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 136 | conf_dir = "#/build/.sconf_temp" | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 137 | log_file="#/build/config.log" | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 138 | config_h="#/include/config.h" | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 139 | conf = Configure(env, conf_dir=conf_dir, log_file=log_file, config_h=config_h, | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 140 | 	custom_tests = {
 | 
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 141 | 'CheckPlatform' : CheckPlatform, 'CheckCPUFlags' : CheckCPUFlags, | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 142 | 'CheckIntelC' : CheckIntelC, 'CheckGCC' : CheckGCC, 'CheckMSVC' : CheckMSVC}) | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 143 | conf.CheckPlatform() | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 144 | |
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 145 | conf.CheckGCC() | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 146 | if platform == 'win32': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 147 | conf.CheckMSVC() | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 148 | intelc = False | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 149 | else: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 150 | conf.CheckIntelC() | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 151 | msvc=False | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 152 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 153 | if intelc and (not gcc or conf.env['intelc']): | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 154 | 	Tool('intelc').generate(conf.env)
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 155 | cc = 'intelc' | 
| 94 | 156 | elif msvc and (not gcc or not conf.env['mingw']): | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 157 | 	Tool('default').generate(conf.env)
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 158 | 	conf.Define("MSVC")
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 159 | cc = 'msvc' | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 160 | elif gcc: | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 161 | cc = 'gcc' | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 162 | else: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 163 | cc = 'none' | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 164 | |
| 95 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 165 | if cc == 'intelc' or cc == 'gcc': | 
| 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 166 | conf.CheckCPUFlags() | 
| 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 167 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 168 | if platform == 'win32' and cc == 'gcc': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 169 | conf.env.Append(LIBPATH=["C:/mingw/lib", "C:/msys/mingw/lib"]) | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 170 | conf.env.Append(CPPPATH=["C:/mingw/include", "C:/msys/mingw/include"]) | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 171 | |
| 67 
249553e1d4fe
new option to choose single or double precision floats
 Radek Brich <radek.brich@devl.cz> parents: 
66diff
changeset | 172 | add_flags = '' | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 173 | if cc == 'gcc': | 
| 68 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 174 | add_flags += cpuflags_gcc + ' -ffast-math ' | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 175 | if cc == 'intelc': | 
| 
2c154aad7f33
added detection of optimal CPU flags for both GCC and IntelC
 Radek Brich <radek.brich@devl.cz> parents: 
67diff
changeset | 176 | add_flags += cpuflags_intelc + ' ' | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 177 | if cc == 'msvc': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 178 | add_flags += '/fp:fast ' | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 179 | if conf.env['simd']: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 180 | add_flags += '/arch:SSE ' | 
| 67 
249553e1d4fe
new option to choose single or double precision floats
 Radek Brich <radek.brich@devl.cz> parents: 
66diff
changeset | 181 | |
| 91 | 182 | if conf.env['force_flags']: | 
| 183 | add_flags = conf.env['flags'] + ' ' | |
| 184 | else: | |
| 185 | add_flags += conf.env['flags'] + ' ' | |
| 186 | ||
| 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: 
85diff
changeset | 187 | if conf.env['precision'] == 'double': | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 188 | 	conf.Define("PYRIT_DOUBLE")
 | 
| 67 
249553e1d4fe
new option to choose single or double precision floats
 Radek Brich <radek.brich@devl.cz> parents: 
66diff
changeset | 189 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 190 | if not conf.env['simd'] or conf.env['precision'] == 'double': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 191 | 	conf.Define("NO_SIMD")
 | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 192 | |
| 66 | 193 | if cc == 'intelc': | 
| 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: 
85diff
changeset | 194 | conf.env.Append(CCFLAGS="-O3 -w1 " + add_flags) | 
| 66 | 195 | elif cc == 'gcc': | 
| 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: 
85diff
changeset | 196 | conf.env.Append(CCFLAGS="-O3 -Wall -pipe " + add_flags) | 
| 93 | 197 | # Other useful flags: | 
| 198 | # -Wunsafe-loop-optimizations -Wpointer-arith -Wcast-align -Wconversion | |
| 199 | # -Wmissing-noreturn -Winline -Wdisabled-optimization | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 200 | elif cc == 'msvc': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 201 | conf.env.Append(CCFLAGS="/Ox /Ob2 /GS- /Gy /GF /GR- /Zp16 /MD /EHsc /vmb " + add_flags) | 
| 65 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 202 | else: | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 203 | print "No supported compiler found." | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 204 | Exit(1) | 
| 
242839c6d27d
basic detection of compiler (GCC or ICC) and CPU capabilities
 Radek Brich <radek.brich@devl.cz> parents: 
64diff
changeset | 205 | |
| 66 | 206 | print "Using compiler: " + cc | 
| 67 
249553e1d4fe
new option to choose single or double precision floats
 Radek Brich <radek.brich@devl.cz> parents: 
66diff
changeset | 207 | print "Additional flags: " + add_flags | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 208 | |
| 93 | 209 | if conf.env['profile'] and cc == 'gcc': | 
| 210 | conf.env.Append(CCFLAGS="-pg", LINKFLAGS="-pg") | |
| 211 | ||
| 95 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 212 | if conf.env['ldflags']: | 
| 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 213 | conf.env.Append(LINKFLAGS=conf.env['ldflags']) | 
| 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 214 | |
| 93 | 215 | |
| 216 | # configure pthread | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 217 | pthread = True | 
| 93 | 218 | if platform == 'win32': | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 219 | if cc == 'msvc': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 220 | 		if not conf.CheckLib('pthreadVC2'):
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 221 | pthread = False | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 222 | elif cc == 'gcc': | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 223 | 		if not conf.CheckLib('pthreadGC2'):
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 224 | pthread = False | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 225 | else: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 226 | conf.env.Append(CCFLAGS="-pthread ") | 
| 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: 
85diff
changeset | 227 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 228 | if not pthread: | 
| 91 | 229 | print 'Error: Cannot build without pthread.' | 
| 230 | Exit(1) | |
| 231 | ||
| 93 | 232 | |
| 233 | # configure libpng | |
| 95 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 234 | if conf.CheckLibWithHeader('libpng', 'png.h', 'C'):
 | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 235 | 	conf.Define('HAVE_PNG')
 | 
| 91 | 236 | |
| 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: 
85diff
changeset | 237 | env = conf.Finish() | 
| 
f7edb3b90816
merge pixmap handling from sampler, material.h and ccdemos's image module to new Pixmap class
 Radek Brich <radek.brich@devl.cz> parents: 
85diff
changeset | 238 | |
| 93 | 239 | |
| 240 | # configure Python | |
| 241 | pyenv = env.Clone() | |
| 242 | have_python = True | |
| 243 | if platform == 'win32': | |
| 244 | pythonver = '%c%c' % (sys.version[0], sys.version[2]) | |
| 245 | pythonlib = 'python'+pythonver | |
| 246 | pythonpath = [env['pythonpath'], | |
| 247 | 'C:\\Program Files\\Python'+pythonver] | |
| 248 | pyenv.Append(CPPPATH=[s+'\\include' for s in pythonpath]) | |
| 249 | pyenv.Append(LIBPATH=[s+'\\libs' for s in pythonpath]) | |
| 250 | pyenv.Replace(SHLIBSUFFIX='.pyd') | |
| 251 | conf = Configure(pyenv, conf_dir=conf_dir, log_file=log_file, config_h=config_h) | |
| 252 | if not conf.CheckLib(pythonlib): | |
| 253 | have_python = False | |
| 254 | pyenv = conf.Finish() | |
| 255 | else: | |
| 256 | try: | |
| 257 | 		pyenv.ParseConfig('python-config --includes --libs')
 | |
| 258 | except: | |
| 259 | have_python = False | |
| 260 | ||
| 261 | if not have_python: | |
| 262 | print "Error: Python is required." | |
| 263 | Exit(1) | |
| 264 | ||
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 265 | # configure SDL | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 266 | sdlenv = env.Clone() | 
| 93 | 267 | if cc == 'msvc': | 
| 268 | sdlenv.Append(LIBS=['SDL', 'SDLmain']) | |
| 269 | sdlenv.Append(LINKFLAGS="/SUBSYSTEM:WINDOWS") | |
| 270 | else: | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 271 | try: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 272 | 		sdlenv.ParseConfig('sh sdl-config --cflags')
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 273 | 		sdlenv.ParseConfig('sh sdl-config --libs')
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 274 | except: | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 275 | pass | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 276 | |
| 93 | 277 | def CheckSDL(context): | 
| 278 | global have_sdl | |
| 279 | 	context.Message('Checking for SDL... ')
 | |
| 280 | 	if context.TryLink("#include <SDL.h>\n"+
 | |
| 281 | 		"int main(int argc,char **argv){return 0;}", '.cc'):
 | |
| 282 | context.Result(1) | |
| 283 | return True | |
| 284 | else: | |
| 285 | 		context.Result("no (some demos won't be built)")
 | |
| 286 | return False | |
| 287 | ||
| 288 | conf = Configure(sdlenv, conf_dir=conf_dir, log_file=log_file, config_h=config_h, | |
| 289 | 	custom_tests = {'CheckSDL' : CheckSDL} )
 | |
| 290 | have_sdl = conf.CheckSDL() | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 291 | sdlenv = conf.Finish() | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 292 | |
| 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: 
85diff
changeset | 293 | |
| 
f7edb3b90816
merge pixmap handling from sampler, material.h and ccdemos's image module to new Pixmap class
 Radek Brich <radek.brich@devl.cz> parents: 
85diff
changeset | 294 | ### build targets | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 295 | |
| 95 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 296 | Export('env pyenv sdlenv have_sdl cc')
 | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 297 | lib = SConscript('src/SConscript', build_dir='build/lib', duplicate=0,
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 298 | 	exports={'buildmodule':False})
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 299 | pymodule = SConscript('src/SConscript', build_dir='build/pymodule', duplicate=0,
 | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 300 | 	exports={'buildmodule':True})
 | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 301 | |
| 95 
ca7d4c665531
build script fixes, add ldflags build option
 Radek Brich <radek.brich@devl.cz> parents: 
94diff
changeset | 302 | SConscript('ccdemos/SConscript', build_dir='build/ccdemos', duplicate=0, exports='lib')
 | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 303 | SConscript('demos/SConscript', exports='pymodule')
 | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 304 | SConscript('tests/SConscript', build_dir='build/tests', duplicate=0, exports='lib')
 | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 305 | SConscript('models/SConscript')
 | 
| 60 | 306 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 307 | env.Alias('demos', ['cc-demos', 'python-demos'])
 | 
| 91 | 308 | env.Alias('libs', ['static-lib', 'python-module'])
 | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 309 | env.Alias('docs', Command('docs/html', [], 'doxygen'))
 | 
| 66 | 310 | env.Clean('docs', ['docs/html'])
 | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 311 | env.Alias('no-docs', ['libs', 'demos', 'models'])
 | 
| 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 312 | env.Alias('no-download', ['libs', 'demos', 'local-models'])
 | 
| 64 
5785cca4cdb9
add Help with list of targets to SConstruct
 Radek Brich <radek.brich@devl.cz> parents: 
63diff
changeset | 313 | env.Alias('all', ['no-docs', 'docs'])
 | 
| 63 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 314 | env.Alias('pyrit', 'no-download')
 | 
| 
440e1ae80459
add many SCons targets (see DEVNOTES)
 Radek Brich <radek.brich@devl.cz> parents: 
62diff
changeset | 315 | Default('pyrit')
 |