diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-06 23:49:46 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-06 23:49:46 +0300 |
commit | addd6ff33184614c6ad191436d34ea7528b17878 (patch) | |
tree | 34a8efb72bfb266f9ab47d65522883eaac6e70a6 /project/boost | |
parent | "toolchain" -> "toolset", part 1 (diff) | |
download | cmake-common-addd6ff33184614c6ad191436d34ea7528b17878.tar.gz cmake-common-addd6ff33184614c6ad191436d34ea7528b17878.zip |
"toolchain" -> "toolset", part 2
Diffstat (limited to 'project/boost')
-rw-r--r-- | project/boost/build.py | 24 | ||||
-rw-r--r-- | project/boost/directory.py | 10 | ||||
-rw-r--r-- | project/boost/toolset.py | 26 |
3 files changed, 30 insertions, 30 deletions
diff --git a/project/boost/build.py b/project/boost/build.py index d1766ee..565610a 100644 --- a/project/boost/build.py +++ b/project/boost/build.py @@ -31,8 +31,8 @@ import sys import tempfile from project.boost.directory import BoostDir -from project.toolset import ToolchainType -from project.boost.toolset import Toolchain +from project.toolset import ToolsetHint +from project.boost.toolset import Toolset from project.configuration import Configuration from project.linkage import Linkage from project.platform import Platform @@ -53,7 +53,7 @@ B2_VERBOSE = ['warnings=all', '-d2', '--debug-configuration'] class BuildParameters: def __init__(self, boost_dir, build_dir=None, platforms=None, configurations=None, link=None, runtime_link=None, - toolset=None, verbose=False, b2_args=None): + toolset_hint=None, verbose=False, b2_args=None): boost_dir = normalize_path(boost_dir) if build_dir is not None: @@ -62,7 +62,7 @@ class BuildParameters: configurations = configurations or DEFAULT_CONFIGURATIONS link = link or DEFAULT_LINK runtime_link = runtime_link or DEFAULT_RUNTIME_LINK - toolset = toolset or ToolchainType.AUTO + toolset_hint = toolset_hint or ToolsetHint.AUTO verbosity = B2_VERBOSE if verbose else B2_QUIET if b2_args: b2_args = verbosity + b2_args @@ -75,7 +75,7 @@ class BuildParameters: self.configurations = configurations self.link = link self.runtime_link = runtime_link - self.toolset = toolset + self.toolset_hint = toolset_hint self.b2_args = b2_args @staticmethod @@ -85,10 +85,10 @@ class BuildParameters: def enum_b2_args(self): with self._create_build_dir() as build_dir: for platform in self.platforms: - toolchain = Toolchain.make(self.toolset, platform) + toolset = Toolset.make(self.toolset_hint, platform) for configuration in self.configurations: for link, runtime_link in self._enum_linkage_options(): - with self._b2_args(build_dir, toolchain, platform, configuration, link, runtime_link) as args: + with self._b2_args(build_dir, toolset, platform, configuration, link, runtime_link) as args: yield args def _enum_linkage_options(self): @@ -119,8 +119,8 @@ class BuildParameters: return @contextmanager - def _b2_args(self, build_dir, toolchain, platform, configuration, link, runtime_link): - with toolchain.b2_args() as result: + def _b2_args(self, build_dir, toolset, platform, configuration, link, runtime_link): + with toolset.b2_args() as result: result.append(f'--build-dir={build_dir}') result.append('--layout=system') result += platform.b2_args(configuration) @@ -168,9 +168,9 @@ def _parse_args(argv=None): type=Linkage.parse, default=DEFAULT_RUNTIME_LINK, help=f'how the libraries link to the runtime ({linkage_options})') - toolset_options = '/'.join(map(str, ToolchainType.all())) - parser.add_argument('--toolset', metavar='TOOLSET', - type=ToolchainType.parse, default=ToolchainType.AUTO, + toolset_options = '/'.join(map(str, ToolsetHint.all())) + parser.add_argument('--toolset', metavar='TOOLSET', dest='toolset_hint', + type=ToolsetHint.parse, default=ToolsetHint.AUTO, help=f'toolset to use ({toolset_options})') parser.add_argument('--build', metavar='DIR', dest='build_dir', diff --git a/project/boost/directory.py b/project/boost/directory.py index 7c39383..be660ab 100644 --- a/project/boost/directory.py +++ b/project/boost/directory.py @@ -6,7 +6,7 @@ import logging import os.path -from project.boost.toolset import Toolchain +from project.boost.toolset import Toolset from project.utils import cd, run from project.os import on_windows @@ -33,7 +33,7 @@ class BoostDir: def bootstrap(self, params): with self._go(): - run([self._bootstrap_path()] + self._bootstrap_args(params.toolset)) + run([self._bootstrap_path()] + self._bootstrap_args(params.toolset_hint)) def _b2(self, params): for b2_params in params.enum_b2_args(): @@ -52,10 +52,10 @@ class BoostDir: @staticmethod def _bootstrap_args(hint): - toolchain = Toolchain.detect(hint) + toolset = Toolset.detect(hint) if on_windows(): - return toolchain.get_bootstrap_bat_args() - return toolchain.get_bootstrap_sh_args() + return toolset.get_bootstrap_bat_args() + return toolset.get_bootstrap_sh_args() @staticmethod def _b2_path(): diff --git a/project/boost/toolset.py b/project/boost/toolset.py index c59ef23..7f9be10 100644 --- a/project/boost/toolset.py +++ b/project/boost/toolset.py @@ -13,7 +13,7 @@ import shutil import project.mingw import project.os -from project.toolset import ToolchainType +from project.toolset import ToolsetHint from project.utils import temp_file @@ -23,7 +23,7 @@ def _gcc_or_auto(): return [] -class Toolchain(abc.ABC): +class Toolset(abc.ABC): @contextmanager def b2_args(self): # Write the config file, etc. @@ -41,31 +41,31 @@ class Toolchain(abc.ABC): @staticmethod def detect(hint): - if hint is ToolchainType.AUTO: + if hint is ToolsetHint.AUTO: return Auto - if hint is ToolchainType.MSVC: + if hint is ToolsetHint.MSVC: return MSVC - if hint is ToolchainType.GCC: + if hint is ToolsetHint.GCC: return GCC - if hint is ToolchainType.MINGW: + if hint is ToolsetHint.MINGW: return MinGW - if hint is ToolchainType.CLANG: + if hint is ToolsetHint.CLANG: return Clang - if hint is ToolchainType.CLANG_CL: + if hint is ToolsetHint.CLANG_CL: return ClangCL raise NotImplementedError(f'unrecognized toolset: {hint}') @staticmethod def make(hint, platform): - # Platform is required here, since some toolchains (MinGW-w64) require + # Platform is required here, since some toolsets (MinGW-w64) require # it for the compiler path. - cls = Toolchain.detect(hint) + cls = Toolset.detect(hint) if cls is MinGW: return MinGW(platform) return cls() -class Auto(Toolchain): +class Auto(Toolset): # Let Boost.Build do the detection. Most commonly it means GCC on # Linux-likes and MSVC on Windows. @@ -113,7 +113,7 @@ def _full_exe_name(exe): return os.path.basename(path) -class Custom(Toolchain): +class Custom(Toolset): COMPILER_VERSION = 'custom' def __init__(self, compiler, path=None, build_options=None): @@ -253,7 +253,7 @@ class Clang(Custom): ''' -class ClangCL(Toolchain): +class ClangCL(Toolset): @contextmanager def b2_args(self): yield [ |