diff options
| -rw-r--r-- | .github/actions/check-boost-libraries/action.yml | 4 | ||||
| -rw-r--r-- | project/boost/build.py | 1 | ||||
| -rw-r--r-- | project/build.py | 4 | ||||
| -rw-r--r-- | project/platform.py | 17 |
4 files changed, 20 insertions, 6 deletions
diff --git a/.github/actions/check-boost-libraries/action.yml b/.github/actions/check-boost-libraries/action.yml index 88df016..02f53f8 100644 --- a/.github/actions/check-boost-libraries/action.yml +++ b/.github/actions/check-boost-libraries/action.yml @@ -27,8 +27,8 @@ runs: $libraries = '${{ inputs.libraries }}' $libraries = $libraries.Split(' ') - $stagedir = Join-Path 'stage' '${{ inputs.platform }}' '${{ inputs.configuration }}' - $librarydir = Join-Path $boost_dir $stagedir 'lib' + $installdir = Join-Path 'root' '${{ inputs.platform }}' '${{ inputs.configuration }}' + $librarydir = Join-Path $boost_dir $installdir 'lib' function Get-FileStubs { param( 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): |
