diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2023-03-23 12:10:16 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2023-03-23 12:10:16 +0200 |
commit | 0530c46962c5485e307cbd9a8403411c6f90c997 (patch) | |
tree | 776a9a2487513fa2412325e8e2de5bb122296e76 | |
parent | b85ffbacb12701382da3404c9bd5aaf56e2c883f (diff) | |
download | meson-0530c46962c5485e307cbd9a8403411c6f90c997.zip meson-0530c46962c5485e307cbd9a8403411c6f90c997.tar.gz meson-0530c46962c5485e307cbd9a8403411c6f90c997.tar.bz2 |
Prevent changing backend during reconfigure.keepbackend
-rw-r--r-- | mesonbuild/mesonmain.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 061cde9..2693b4c 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -235,7 +235,20 @@ def set_meson_command(mainfile): from . import mesonlib mesonlib.set_meson_command(mainfile) +def prevent_backend_change(args): + has_reconf = False + has_backend = False + for arg in args: + if arg.startswith('--reconfigure'): + has_reconf = True + if arg.startswith('--backend'): + has_backend = True + if has_reconf and has_backend: + sys.exit('''Setting the backend during reconfiguration is not supported. +If you want to change the backend, you must create a new build directory.''') + def run(original_args, mainfile): + prevent_backend_change(original_args) if os.environ.get('MESON_SHOW_DEPRECATIONS'): # workaround for https://bugs.python.org/issue34624 import warnings |