diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-20 13:16:15 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-20 14:34:32 +0300 |
commit | e731e6345d7fa1c2326b18c56f5dc361ea3adbfb (patch) | |
tree | cc72442867919028eda33b264c02eab47ca3a049 /project/boost/build.py | |
parent | workflows/basic: enable on windows-2016 (diff) | |
download | cmake-common-e731e6345d7fa1c2326b18c56f5dc361ea3adbfb.tar.gz cmake-common-e731e6345d7fa1c2326b18c56f5dc361ea3adbfb.zip |
project.platform: add platform 'auto'
There were two problems:
* On Windows, VS 2019 defaults to x64 while VS 2017 defaults to x86.
* Too much focus on x86(-64) might mean that building stuff on ARM can
become difficult.
These were all addressed by adding a new platform 'auto'. On Windows,
it defaults to picking either x64 or x86 (depending on the host arch)
for both Boost and CMake. On Linux, it lets the compiler decide what
arch to target.
Diffstat (limited to '')
-rw-r--r-- | project/boost/build.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/project/boost/build.py b/project/boost/build.py index b262e47..7cf1364 100644 --- a/project/boost/build.py +++ b/project/boost/build.py @@ -40,7 +40,7 @@ from project.os import on_linux_like from project.utils import normalize_path, setup_logging -DEFAULT_PLATFORMS = (Platform.native(),) +DEFAULT_PLATFORMS = (Platform.AUTO,) DEFAULT_CONFIGURATIONS = (Configuration.DEBUG, Configuration.RELEASE,) # For my development, I link everything statically (to be able to pull the # binaries from a CI, etc. and run them everywhere): @@ -71,7 +71,6 @@ class BuildParameters: self.boost_dir = boost_dir self.build_dir = build_dir - self.stage_dir = 'stage' self.platforms = platforms self.configurations = configurations self.link = link @@ -126,12 +125,11 @@ class BuildParameters: def _build_params(self, build_dir, toolchain, configuration, link, runtime_link): params = [] params.append(self._build_dir(build_dir)) - params.append(self._stagedir(toolchain, configuration)) - params.append('--layout=system') - params += toolchain.get_b2_args() - params.append(self._variant(configuration)) params.append(self._link(link)) params.append(self._runtime_link(runtime_link)) + params.append('--layout=system') + params += toolchain.b2_args(configuration) + params += configuration.b2_args() params += self.b2_args return params @@ -139,11 +137,6 @@ class BuildParameters: def _build_dir(build_dir): return f'--build-dir={build_dir}' - def _stagedir(self, toolchain, configuration): - platform = str(toolchain.platform) - configuration = str(configuration) - return f'--stagedir={os.path.join(self.stage_dir, platform, configuration)}' - @staticmethod def _link(link): return f'link={link}' |