Added --compiler option and made --config actually work.
This commit is contained in:
parent
b2a81cadb9
commit
3e370bfa52
32
SConscript
32
SConscript
@ -127,13 +127,43 @@ AddOption(
|
|||||||
default = 'config.py'
|
default = 'config.py'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AddOption(
|
||||||
|
'--compiler',
|
||||||
|
dest = 'compiler',
|
||||||
|
type = 'choice',
|
||||||
|
choices = ('auto', 'gcc', 'clang', 'msvc'),
|
||||||
|
nargs = 1,
|
||||||
|
action = 'store',
|
||||||
|
default = 'auto'
|
||||||
|
)
|
||||||
|
|
||||||
build_type = GetOption('build_type')
|
build_type = GetOption('build_type')
|
||||||
unity_mode = GetOption('unity_mode')
|
unity_mode = GetOption('unity_mode')
|
||||||
variant = GetOption('variant')
|
variant = GetOption('variant')
|
||||||
enable_asan = GetOption('enable_asan')
|
enable_asan = GetOption('enable_asan')
|
||||||
config_file = GetOption('config_file')
|
config_file = GetOption('config_file')
|
||||||
|
compiler = GetOption('compiler')
|
||||||
|
|
||||||
env = Environment(tools = ['default', 'compilation_db', 'unity_build'])
|
default_CC = {
|
||||||
|
'gcc': 'gcc',
|
||||||
|
'clang': 'clang',
|
||||||
|
'msvc': 'cl.exe'
|
||||||
|
}.get(compiler, None)
|
||||||
|
default_CXX = {
|
||||||
|
'gcc': 'g++',
|
||||||
|
'clang': 'clang++',
|
||||||
|
'msvc': 'cl.exe'
|
||||||
|
}.get(compiler, None)
|
||||||
|
|
||||||
|
vars = Variables(config_file)
|
||||||
|
vars.Add('CC', 'The C Compiler', default_CC)
|
||||||
|
vars.Add('CXX', 'The C++ Compiler', default_CXX)
|
||||||
|
vars.Add('LINK', 'The Linker')
|
||||||
|
vars.Add('CCFLAGS', 'C/C++ Compiler Flags')
|
||||||
|
vars.Add('LINKFLAGS', 'Linker Flags')
|
||||||
|
vars.Add('PYTHON', 'Python Executable', 'python')
|
||||||
|
|
||||||
|
env = Environment(tools = ['default', 'compilation_db', 'unity_build'], variables = vars)
|
||||||
env['RECIPES_FOLDERS'] = [Dir('recipes')]
|
env['RECIPES_FOLDERS'] = [Dir('recipes')]
|
||||||
env['SYSTEM_CACHE_DIR'] = os.path.join(_find_system_cache_dir(), 'spp_cache')
|
env['SYSTEM_CACHE_DIR'] = os.path.join(_find_system_cache_dir(), 'spp_cache')
|
||||||
env['CLONE_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'cloned')
|
env['CLONE_DIR'] = os.path.join(env['SYSTEM_CACHE_DIR'], 'cloned')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user