aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/boost
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-01-08 15:04:13 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-01-08 15:04:13 +0300
commit0c39df9043fc3bfc94095beee0a081238280dd00 (patch)
tree3ed8e9a282d3eb78bdb055d8578db77b0d9aa131 /boost
parentcmake/build/ci: fix import errors (diff)
downloadcmake-common-0c39df9043fc3bfc94095beee0a081238280dd00.tar.gz
cmake-common-0c39df9043fc3bfc94095beee0a081238280dd00.zip
boost/build: refactoring
Diffstat (limited to 'boost')
-rwxr-xr-xboost/build/build.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/boost/build/build.py b/boost/build/build.py
index e04aa30..7102c3f 100755
--- a/boost/build/build.py
+++ b/boost/build/build.py
@@ -100,21 +100,21 @@ def _parse_configuration(s):
raise argparse.ArgumentTypeError(f'invalid configuration: {s}')
-class Link(Enum):
+class Linkage(Enum):
STATIC = 'static'
SHARED = 'shared'
@staticmethod
def all():
- return tuple(Link)
+ return tuple(Linkage)
def __str__(self):
return self.value
-def _parse_link(s):
+def _parse_linkage(s):
try:
- return Link(s)
+ return Linkage(s)
except ValueError:
raise argparse.ArgumentTypeError(f'invalid linkage: {s}')
@@ -292,7 +292,7 @@ class BoostDir:
_run_executable(self._bootstrap_path())
def _b2(self, params):
- for b2_params in params.enum_b2_params():
+ for b2_params in params.enum_b2_args():
_run_executable([self._b2_path()] + b2_params)
@staticmethod
@@ -318,11 +318,11 @@ class BoostDir:
return f'b2{ext}'
-class BoostBuild:
+class BuildParameters:
def __init__(self, args):
self.platforms = args.platforms or Platform.all()
self.configurations = args.configurations or Configuration.all()
- self.link = args.link or Link.all()
+ self.link = args.link or Linkage.all()
self.stage_dir = 'stage'
@@ -331,7 +331,7 @@ class BoostBuild:
self.b2_args = args.b2_args
- def enum_b2_params(self):
+ def enum_b2_args(self):
with self._create_build_dir() as build_dir:
for platform in self.platforms:
platform_params = [f'--build-dir={build_dir}']
@@ -429,7 +429,7 @@ def _parse_args(argv=None):
# are built on Windows by default.
build.add_argument('--link', metavar='LINKAGE',
nargs='*', default=[],
- type=_parse_link,
+ type=_parse_linkage,
help='how the libraries are linked (i.e. static/shared)')
build.add_argument('--build', metavar='DIR', dest='build_dir',
@@ -446,7 +446,7 @@ def _parse_args(argv=None):
def build(args):
- build_params = BoostBuild(args)
+ build_params = BuildParameters(args)
boost_dir = BoostDir(args.boost_dir)
boost_dir.build(build_params)