1 #######################################################################
9 import platform
as _platform
11 import SCons
.Script
.SConscript
14 #######################################################################
17 host_platform
= _platform
.system().lower()
19 # Search sys.argv[] for a "platform=foo" argument since we don't have
20 # an 'env' variable at this point.
21 if 'platform' in SCons
.Script
.ARGUMENTS
:
22 target_platform
= SCons
.Script
.ARGUMENTS
['platform']
24 target_platform
= host_platform
37 # find host_machine value
38 if 'PROCESSOR_ARCHITECTURE' in os
.environ
:
39 host_machine
= os
.environ
['PROCESSOR_ARCHITECTURE']
41 host_machine
= _platform
.machine()
42 host_machine
= _machine_map
.get(host_machine
, 'generic')
44 default_machine
= host_machine
45 default_toolchain
= 'default'
47 if target_platform
== 'windows' and host_platform
!= 'windows':
48 default_machine
= 'x86'
49 default_toolchain
= 'crossmingw'
52 # find default_llvm value
53 if 'LLVM' in os
.environ
:
58 if target_platform
!= 'windows' and \
59 subprocess
.call(['llvm-config', '--version'], stdout
=subprocess
.PIPE
) == 0:
65 #######################################################################
70 from SCons
.Variables
.BoolVariable
import BoolVariable
as BoolOption
72 from SCons
.Options
.BoolOption
import BoolOption
74 from SCons
.Variables
.EnumVariable
import EnumVariable
as EnumOption
76 from SCons
.Options
.EnumOption
import EnumOption
77 opts
.Add(EnumOption('build', 'build type', 'debug',
78 allowed_values
=('debug', 'checked', 'profile', 'release')))
79 opts
.Add(BoolOption('quiet', 'quiet command lines', 'yes'))
80 opts
.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine
,
81 allowed_values
=('generic', 'ppc', 'x86', 'x86_64')))
82 opts
.Add(EnumOption('platform', 'target platform', host_platform
,
83 allowed_values
=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin', 'embedded', 'cygwin', 'sunos5', 'freebsd8')))
84 opts
.Add('toolchain', 'compiler toolchain', default_toolchain
)
85 opts
.Add(BoolOption('gles', 'EXPERIMENTAL: enable OpenGL ES support', 'no'))
86 opts
.Add(BoolOption('llvm', 'use LLVM', default_llvm
))
87 opts
.Add(BoolOption('debug', 'DEPRECATED: debug build', 'yes'))
88 opts
.Add(BoolOption('profile', 'DEPRECATED: profile build', 'no'))
89 opts
.Add(EnumOption('MSVS_VERSION', 'MS Visual C++ version', None, allowed_values
=('7.1', '8.0', '9.0')))