diff options
author | Anthony Barbier <anthony.barbier@arm.com> | 2019-02-15 15:20:25 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2019-03-15 11:14:09 +0000 |
commit | 9c4ba7a5f03a5714b2dc965042f2a5fff8a4ee70 (patch) | |
tree | 93d8aee34fbadf767b97f878e0169d7372f7edc4 /SConstruct | |
parent | f2986e15058c33c41f1fc613c1a9785a5670cc24 (diff) | |
download | vixl-9c4ba7a5f03a5714b2dc965042f2a5fff8a4ee70.tar.gz |
Add support for compiler caches
- Add support for compiler wrappers in SCons (Disabled by default).
- In tools/test.py: enable ccache if it is available.
- Set the environment variable CCACHE_CPP2 to 'yes' to fix warnings on
ubuntu 16.04.
Change-Id: If8d1b094143a5c1a9c58fd7c204655f8889d34fd
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -251,7 +251,8 @@ vars.AddVariables( 'Configure the allocation mechanism in the CodeBuffer', ['malloc', 'mmap']), ('std', 'C++ standard. The standards tested are: %s.' % \ - ', '.join(config.tested_cpp_standards)) + ', '.join(config.tested_cpp_standards)), + ('compiler_wrapper', 'Command to prefix to the C and C++ compiler (e.g ccache)', '') ) # We use 'variant directories' to avoid recompiling multiple times when build @@ -259,7 +260,7 @@ vars.AddVariables( # set. These are the options that should be reflected in the build directory # path. options_influencing_build_path = [ - 'target', 'mode', 'symbols', 'CXX', 'std', 'simulator', 'negative_testing', + 'target', 'mode', 'symbols', 'compiler', 'std', 'simulator', 'negative_testing', 'code_buffer_allocator' ] @@ -403,6 +404,10 @@ def ConfigureEnvironmentForCompiler(env): def ConfigureEnvironment(env): RetrieveEnvironmentVariables(env) + env['compiler'] = env['CXX'] + if env['compiler_wrapper'] != '': + env['CXX'] = env['compiler_wrapper'] + ' ' + env['CXX'] + env['CC'] = env['compiler_wrapper'] + ' ' + env['CC'] env['host_arch'] = util.GetHostArch(env) ProcessBuildOptions(env) if 'std' in env: |