aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--.github/actions/build-boost/action.yml2
-rw-r--r--.github/workflows/basic.yml4
-rw-r--r--README.md2
-rw-r--r--project/boost/build.py33
4 files changed, 25 insertions, 16 deletions
diff --git a/.github/actions/build-boost/action.yml b/.github/actions/build-boost/action.yml
index fdd4fdc..71154b7 100644
--- a/.github/actions/build-boost/action.yml
+++ b/.github/actions/build-boost/action.yml
@@ -31,7 +31,7 @@ runs:
}
$libraries = '${{ inputs.libraries }}'
- $libraries = $libraries.Split(' ') | %{ "--with-$_" }
+ $libraries = $libraries.Split(' ')
if (-not $libraries) {
Remove-Variable libraries
}
diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml
index f2e641c..5b1f63e 100644
--- a/.github/workflows/basic.yml
+++ b/.github/workflows/basic.yml
@@ -48,7 +48,7 @@ jobs:
- name: Build Boost
run: |
python -m project.boost.download --cache . '${{ matrix.boost-version }}' boost/
- python -m project.boost.build -- boost/ --with-filesystem
+ python -m project.boost.build boost/ filesystem
- name: Build example project
run: |
$src_dir = Join-Path examples boost
@@ -93,7 +93,7 @@ jobs:
- name: Build Boost
run: |
boost-download --cache . '${{ matrix.boost-version }}' boost/
- boost-build -- boost/ --with-filesystem
+ boost-build boost/ filesystem
- name: Build example project
run: |
$src_dir = Join-Path examples boost
diff --git a/README.md b/README.md
index ca91bba..ad14966 100644
--- a/README.md
+++ b/README.md
@@ -73,7 +73,7 @@ Download & build the Boost libraries in a cross-platform way.
$ boost-download 1.72.0
...
- $ boost-build -- boost_1_72_0/ --with-filesystem --with-program_options
+ $ boost-build boost_1_72_0/ filesystem program_options
...
Pass the `--help` flag to view detailed usage information.
diff --git a/project/boost/build.py b/project/boost/build.py
index 3ecd22c..e74004d 100644
--- a/project/boost/build.py
+++ b/project/boost/build.py
@@ -13,7 +13,7 @@ with the help from the --toolset and --platform parameters.
Usage example:
- $ boost-build -- boost_1_71_0/ --with-filesystem --with-program_options
+ $ boost-build boost_1_71_0/ filesystem program_options
...
Consult the output of `boost-build --help` for more details.
@@ -55,11 +55,12 @@ B2_VERBOSE = ['warnings=all', '-d2', '--debug-configuration']
class BuildParameters:
- def __init__(self, boost_dir, build_dir=None, platforms=None,
+ def __init__(self, boost_dir, libraries, build_dir=None, platforms=None,
configurations=None, link=None, runtime_link=None,
toolset_version=None, verbose=False, b2_args=None):
boost_dir = normalize_path(boost_dir)
+ libraries = libraries or []
if build_dir is not None:
build_dir = normalize_path(build_dir)
platforms = platforms or DEFAULT_PLATFORMS
@@ -74,6 +75,7 @@ class BuildParameters:
b2_args = verbosity
self.boost_dir = boost_dir
+ self.libraries = libraries
self.build_dir = build_dir
self.platforms = platforms
self.configurations = configurations
@@ -91,10 +93,9 @@ class BuildParameters:
def enum_b2_args(self):
with self._create_build_dir() as build_dir:
for platform in self.platforms:
- toolset = Toolset.make(self.toolset_version, platform)
for configuration in self.configurations:
for link, runtime_link in self._enum_linkage_options():
- with self._b2_args(build_dir, toolset, platform, configuration, link, runtime_link) as args:
+ with self._b2_args(build_dir, platform, configuration, link, runtime_link) as args:
yield args
def _enum_linkage_options(self):
@@ -125,7 +126,8 @@ class BuildParameters:
return
@contextmanager
- def _b2_args(self, build_dir, toolset, platform, configuration, link, runtime_link):
+ def _b2_args(self, build_dir, platform, configuration, link, runtime_link):
+ toolset = Toolset.make(self.toolset_version, platform)
with toolset.b2_args() as result:
result.append(f'--build-dir={build_dir}')
result.append('--layout=system')
@@ -134,6 +136,8 @@ class BuildParameters:
result += link.b2_args()
result += runtime_link.b2_args('runtime-link')
result += self.b2_args
+ if self.libraries:
+ result += [f'--with-{lib}' for lib in self.libraries]
result += ['install']
yield result
@@ -181,24 +185,29 @@ def _parse_args(argv=None):
type=Linkage.parse, default=DEFAULT_RUNTIME_LINK,
help=f'how the libraries link to the runtime ({linkage_options})')
+ parser.add_argument('--build', metavar='DIR', dest='build_dir',
+ type=normalize_path,
+ help='Boost build directory (temporary directory unless specified)')
+
parser.add_argument('--toolset', metavar='TOOLSET', dest='toolset_version',
type=ToolsetVersion.parse, default=DEFAULT_TOOLSET_VERSION,
help=f'toolset to use ({ToolsetVersion.usage()})')
parser.add_argument('--help-toolsets', action='store_true',
help='show detailed info about supported toolsets')
- parser.add_argument('--build', metavar='DIR', dest='build_dir',
- type=normalize_path,
- help='Boost build directory (temporary directory unless specified)')
- parser.add_argument('boost_dir', metavar='DIR',
+ parser.add_argument('--b2-arg', metavar='ARG', dest='b2_args',
+ action='extend', nargs='*',
+ help='additional b2 arguments, to be passed verbatim')
+
+ parser.add_argument('boost_dir', metavar='BOOST_DIR',
type=normalize_path,
help='root Boost directory')
+ parser.add_argument('libraries', metavar='LIBRARIES',
+ action='extend', nargs='*',
+ help='libraries to build (all libraries by default)')
parser.add_argument('-v', '--verbose', action='store_true',
help='verbose b2 invocation (quiet by default)')
- parser.add_argument('b2_args', metavar='B2_ARG',
- nargs='*', default=[],
- help='additional b2 arguments, to be passed verbatim')
return parser.parse_args(argv)