aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/project/configuration.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--project/configuration.py24
1 files changed, 22 insertions, 2 deletions
diff --git a/project/configuration.py b/project/configuration.py
index 4b25c6e..5bfc317 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 to_boost_variant(self):
+ def variant(self):
'''Roughly maps CMake's CMAKE_BUILD_TYPE to Boost's variant.
AFAIK, Boost only supports debug/release, MinSizeRel and RelWithDebInfo
@@ -38,5 +38,25 @@ class Configuration(Enum):
MinSizeRel/RelWithDebInfo.
'''
if self in (Configuration.MINSIZEREL, Configuration.RELWITHDEBINFO):
- return Configuration.RELEASE.to_boost_variant()
+ return Configuration.RELEASE.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 ['-D', f'CMAKE_BUILD_TYPE={self.build_type()}']
+
+ def cmake_args(self):
+ args = []
+ args += self.cmake_build_type()
+ return args