scons: added ctool option to specify c compiler command

if cxxtool option is unspecified it will be derived from ctool
This commit is contained in:
loonycyborg 2015-12-02 16:02:53 +03:00
parent 3a5b122325
commit 4456dcbfaf

View file

@ -100,6 +100,7 @@ opts.AddVariables(
('jobs', 'Set the number of parallel compilations', "1", lambda key, value, env: int(value), int),
BoolVariable('distcc', 'Use distcc', False),
BoolVariable('ccache', "Use ccache", False),
('ctool', 'Set c compiler command if not using standard compiler.'),
('cxxtool', 'Set c++ compiler command if not using standard compiler.'),
BoolVariable('cxx0x', 'Use C++0x features.', False),
BoolVariable('openmp', 'Enable openmp use.', False),
@ -157,10 +158,15 @@ else:
from cross_compile import *
setup_cross_compile(env)
if 'HOME' in os.environ:
env['ENV']['HOME'] = os.environ['HOME']
if env.get('ctool',""):
env['CC'] = env['ctool']
env['CXX'] = env['ctool'].rstrip("cc") + "++"
if env.get('cxxtool',""):
env['CXX'] = env['cxxtool']
if 'HOME' in os.environ:
env['ENV']['HOME'] = os.environ['HOME']
if env['jobs'] > 1:
SetOption("num_jobs", env['jobs'])