Skip to content

Commit

Permalink
scons: added ctool option to specify c compiler command
Browse files Browse the repository at this point in the history
if cxxtool option is unspecified it will be derived from ctool
  • Loading branch information
loonycyborg committed Dec 2, 2015
1 parent 88d4c15 commit 3fd592c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SConstruct
Expand Up @@ -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),
Expand Down Expand Up @@ -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'])
Expand Down

0 comments on commit 3fd592c

Please sign in to comment.