aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-03-30 11:00:00 +0200
committerEgor Tensin <egor@tensin.name>2026-03-30 11:00:00 +0200
commit1d2aa7c59ec3e7532064fa6ee41e94b526a7277a (patch)
tree53f30638f02654e204f2ab0ed1a0ba4be38b21b3
parentfix PyLint warnings (diff)
downloadcmake-common-1d2aa7c59ec3e7532064fa6ee41e94b526a7277a.tar.gz
cmake-common-1d2aa7c59ec3e7532064fa6ee41e94b526a7277a.zip
project.configuration: refactoring
-rw-r--r--project/configuration.py22
1 files changed, 4 insertions, 18 deletions
diff --git a/project/configuration.py b/project/configuration.py
index 19a4b3b..ea78726 100644
--- a/project/configuration.py
+++ b/project/configuration.py
@@ -29,7 +29,7 @@ class Configuration(Enum):
except ValueError as e:
raise argparse.ArgumentTypeError(f'invalid configuration: {s}') from e
- def variant(self):
+ def b2_variant(self):
'''Roughly maps CMake's CMAKE_BUILD_TYPE to Boost's variant.
AFAIK, Boost only supports debug/release, MinSizeRel and RelWithDebInfo
@@ -38,25 +38,11 @@ class Configuration(Enum):
MinSizeRel/RelWithDebInfo.
'''
if self in (Configuration.MINSIZEREL, Configuration.RELWITHDEBINFO):
- return Configuration.RELEASE.variant()
+ return Configuration.RELEASE.b2_variant()
return str(self).lower()
- def b2_variant(self):
- return [f'variant={self.variant()}']
-
def b2_args(self):
- args = []
- args += self.b2_variant()
- return args
-
- def build_type(self):
- '''Maps to CMAKE_BUILD_TYPE.'''
- return str(self)
-
- def cmake_build_type(self):
- return [f'-DCMAKE_BUILD_TYPE={self.build_type()}']
+ return [f'variant={self.b2_variant()}']
def cmake_args(self):
- args = []
- args += self.cmake_build_type()
- return args
+ return [f'-DCMAKE_BUILD_TYPE={self}']