diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-17 23:53:16 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-01-18 00:16:22 +0300 |
commit | 99eb9822b4dfa67f65674eac92f1371dc4be9d31 (patch) | |
tree | 47fc1f817c805479b96270c9f7425d912f540e9b /boost/build/build.py | |
parent | fix .clang-format (diff) | |
download | cmake-common-99eb9822b4dfa67f65674eac92f1371dc4be9d31.tar.gz cmake-common-99eb9822b4dfa67f65674eac92f1371dc4be9d31.zip |
support all 4 cmake default configurations
Diffstat (limited to '')
-rwxr-xr-x | boost/build/build.py | 15 |
1 files changed, 13 insertions, 2 deletions
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}') |