diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-10-04 21:57:27 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-10-04 21:57:27 +0300 |
commit | 106608bdc2b777ed0483ac0db4c6bc72c1054295 (patch) | |
tree | 51e50292798be002f1a48ab7edd65e5a0099a60c /mesonbuild/wrap/__init__.py | |
parent | c0c075c1298ad9018a62d75a632af1c0d0d7d0f8 (diff) | |
download | meson-exposewrap.tar.gz |
Expose wrap_mode as an option. Closes #4266.exposewrap
Diffstat (limited to 'mesonbuild/wrap/__init__.py')
-rw-r--r-- | mesonbuild/wrap/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/mesonbuild/wrap/__init__.py b/mesonbuild/wrap/__init__.py index b792dfa74..6be2c4492 100644 --- a/mesonbuild/wrap/__init__.py +++ b/mesonbuild/wrap/__init__.py @@ -33,6 +33,15 @@ from enum import Enum # Note that these options do not affect subprojects that # are git submodules since those are only usable in git # repositories, and you almost always want to download them. + +# This did _not_ work when inside the WrapMode class. +# I don't know why. If you can fix this, patches welcome. +string_to_value = {'default': 1, + 'nofallback': 2, + 'nodownload': 3, + 'forcefallback': 4, + } + class WrapMode(Enum): default = 1 nofallback = 2 @@ -41,3 +50,8 @@ class WrapMode(Enum): def __str__(self): return self.name + + @staticmethod + def from_string(mode_name): + g = string_to_value[mode_name] + return WrapMode(g) |