diff options
| author | Egor Tensin <egor@tensin.name> | 2026-01-20 15:46:34 +0100 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-01-20 23:52:38 +0100 |
| commit | 81aecb870a16ad0ff480dac43a11ae3adc7480b3 (patch) | |
| tree | c803e48d3b2123e62feb450a63d0f3248c471bb3 /project | |
| parent | project.toolset: shit code reduction (diff) | |
| download | cmake-common-81aecb870a16ad0ff480dac43a11ae3adc7480b3.tar.gz cmake-common-81aecb870a16ad0ff480dac43a11ae3adc7480b3.zip | |
project.boost: switch from `stage` to `install`
That's part of a global transition aiming to switch to Boost CMake
files. Since 1.70.0, they've been releasing CMake files, which I should
(?) be using. Additionally, modern CMake versions simply deprecate the
FindBoost module (see policy CMP0167), insisting on using the supplied
CMake files. I'll try to continue supporting old Boost versions; let's
see how it goes.
Diffstat (limited to 'project')
| -rw-r--r-- | project/boost/build.py | 1 | ||||
| -rw-r--r-- | project/build.py | 4 | ||||
| -rw-r--r-- | project/platform.py | 17 |
3 files changed, 18 insertions, 4 deletions
diff --git a/project/boost/build.py b/project/boost/build.py index a29fb29..d662cf8 100644 --- a/project/boost/build.py +++ b/project/boost/build.py @@ -134,6 +134,7 @@ class BuildParameters: result += link.b2_args() result += runtime_link.b2_args('runtime-link') result += self.b2_args + result += ['install'] yield result diff --git a/project/build.py b/project/build.py index f718bea..bc9a8d9 100644 --- a/project/build.py +++ b/project/build.py @@ -87,11 +87,9 @@ class GenerationPhase: if self.boost_dir is None: return [] root = self.boost_dir - librarydir = self.platform.boost_librarydir(self.configuration) - librarydir = os.path.join(self.boost_dir, librarydir) + root = os.path.join(root, self.platform.boost_installdir(self.configuration)) return [ f'-DBOOST_ROOT={root}', - f'-DBOOST_LIBRARYDIR={librarydir}', ] @staticmethod diff --git a/project/platform.py b/project/platform.py index ed7ff69..d82694b 100644 --- a/project/platform.py +++ b/project/platform.py @@ -75,6 +75,14 @@ class Platform(Enum): return 64 raise NotImplementedError(f'unsupported platform: {self}') + def installdir(self, configuration): + if self is Platform.AUTO: + if on_windows(): + # On Windows, use the host architecture. + return Platform.windows_native().installdir(configuration) + # On Linux, the libraries are stored in stage/auto/CONFIGURATION/lib. + return os.path.join('root', str(self), str(configuration)) + def stagedir(self, configuration): '''Path to the built libraries inside the Boost build directory.''' if self is Platform.AUTO: @@ -84,6 +92,10 @@ class Platform(Enum): # On Linux, the libraries are stored in stage/auto/CONFIGURATION/lib. return os.path.join('stage', str(self), str(configuration)) + def boost_installdir(self, configuration): + '''Same as above, but for CMake.''' + return self.installdir(configuration) + def boost_librarydir(self, configuration): '''Same as above, but for CMake; adds /lib/ at the end.''' return os.path.join(self.stagedir(configuration), 'lib') @@ -95,13 +107,16 @@ class Platform(Enum): return [] return [f'address-model={self.address_model()}'] + def b2_installdir(self, configuration): + return [f'--prefix={self.installdir(configuration)}'] + def b2_stagedir(self, configuration): return [f'--stagedir={self.stagedir(configuration)}'] def b2_args(self, configuration): args = [] args += self.b2_address_model() - args += self.b2_stagedir(configuration) + args += self.b2_installdir(configuration) return args def cmake_toolset_file(self): |
