diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-06 21:49:18 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-06 23:07:08 +0300 |
commit | 1941d7d04af3d3c22144fdfefc29d39ec444ee8e (patch) | |
tree | 5e912c2256547ad4172c5390c695cd72e579b1e2 /project/boost/build.py | |
parent | workflows: add run_foo.ps1, compact YAML (diff) | |
download | cmake-common-1941d7d04af3d3c22144fdfefc29d39ec444ee8e.tar.gz cmake-common-1941d7d04af3d3c22144fdfefc29d39ec444ee8e.zip |
project.boost: merge BootstrapToolchain and Toolchain
In general, simplify Toolchain a bit. This is done in preparation for
merging project.boost.toolchain, project.cmake.toolchain and
project.toolchain.
Diffstat (limited to '')
-rw-r--r-- | project/boost/build.py | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/project/boost/build.py b/project/boost/build.py index fd5ed24..32b355a 100644 --- a/project/boost/build.py +++ b/project/boost/build.py @@ -85,10 +85,11 @@ class BuildParameters: def enum_b2_args(self): with self._create_build_dir() as build_dir: for platform in self.platforms: - with Toolchain.detect(self.toolset, platform) as toolchain: - for configuration in self.configurations: - for link, runtime_link in self._enum_linkage_options(): - yield self._b2_args(build_dir, toolchain, configuration, link, runtime_link) + toolchain = Toolchain.make(self.toolset, 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: + yield args def _enum_linkage_options(self): for link in self.link: @@ -117,16 +118,17 @@ class BuildParameters: logging.info('Removing build directory: %s', build_dir) return - def _b2_args(self, build_dir, toolchain, configuration, link, runtime_link): - result = [] - result.append(f'--build-dir={build_dir}') - result.append('--layout=system') - result += toolchain.b2_args(configuration) - result += configuration.b2_args() - result += link.b2_args() - result += runtime_link.b2_args('runtime-link') - result += self.b2_args - return result + @contextmanager + def _b2_args(self, build_dir, toolchain, platform, configuration, link, runtime_link): + with toolchain.b2_args() as result: + result.append(f'--build-dir={build_dir}') + result.append('--layout=system') + result += platform.b2_args(configuration) + result += configuration.b2_args() + result += link.b2_args() + result += runtime_link.b2_args('runtime-link') + result += self.b2_args + yield result def build(params): |