From 99eb9822b4dfa67f65674eac92f1371dc4be9d31 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 17 Jan 2020 23:53:16 +0300 Subject: support all 4 cmake default configurations --- boost/build/build.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'boost/build') diff --git a/boost/build/build.py b/boost/build/build.py index 4957e85..fa8475d 100755 --- a/boost/build/build.py +++ b/boost/build/build.py @@ -100,12 +100,23 @@ def _parse_platform(s): class Configuration(Enum): + # AFAIK, Boost only supports debug/release, MinSizeRel and RelWithDebInfo + # are for compatibility with CMake, they map to Release. DEBUG = 'Debug' + MINSIZEREL = 'MinSizeRel' + RELWITHDEBINFO = 'RelWithDebInfo' RELEASE = 'Release' + def normalize(self): + if self is Configuration.MINSIZEREL: + return Configuration.RELEASE + if self is Configuration.RELWITHDEBINFO: + return Configuration.RELEASE + return self + @staticmethod def all(): - return tuple(Configuration) + return set(map(Configuration.normalize, Configuration)) def __str__(self): return self.value @@ -113,7 +124,7 @@ class Configuration(Enum): def _parse_configuration(s): try: - return Configuration(s) + return Configuration(s).normalize() except ValueError: raise argparse.ArgumentTypeError(f'invalid configuration: {s}') -- cgit v1.2.3