diff options
author | Jack Lloyd <[email protected]> | 2020-11-13 08:46:44 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2020-11-13 08:46:44 -0500 |
commit | 7651c9c0d9ff772ec57c21d64da1b0cc90cff8ac (patch) | |
tree | 4950aadba3419ddb3918b7a25770e7508edffdee /configure.py | |
parent | 370a5f0cb8e725f3ec0ba8af7c11527c7c988145 (diff) |
Add --compiler-cache option to configure.py
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/configure.py b/configure.py index 9be4b7bf3..88eeaa575 100755 --- a/configure.py +++ b/configure.py @@ -342,6 +342,9 @@ def process_command_line(args): # pylint: disable=too-many-locals,too-many-state target_group.add_option('--msvc-runtime', metavar='RT', default=None, help='specify MSVC runtime (MT, MD, MTd, MDd)') + target_group.add_option('--compiler-cache', + help='specify a compiler cache to use') + target_group.add_option('--with-endian', metavar='ORDER', default=None, help='override byte order guess') @@ -1996,6 +1999,14 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, return exe + def choose_cxx_exe(): + cxx = options.compiler_binary or cc.binary_name + + if options.compiler_cache is None: + return cxx + else: + return '%s %s' % (options.compiler_cache, cxx) + variables = { 'version_major': Version.major(), 'version_minor': Version.minor(), @@ -2098,7 +2109,7 @@ def create_template_vars(source_paths, build_paths, options, modules, cc, arch, 'python_version': options.python_version, 'install_python_module': not options.no_install_python_module, - 'cxx': (options.compiler_binary or cc.binary_name), + 'cxx': choose_cxx_exe(), 'cxx_abi_flags': cc.mach_abi_link_flags(options), 'linker': cc.linker_name or '$(CXX)', 'make_supports_phony': osinfo.basename != 'windows', |