diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-09-01 00:59:41 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-03-20 17:22:50 -0400 |
commit | a024d75e150334330954bf7a6fdbe8cb02a82491 (patch) | |
tree | 0504f3471f335d79d994d9f68028233f95f38bb5 /mesonbuild/backend/nonebackend.py | |
parent | 2a0b80eb679f27402035faa93b3b6b16f5839724 (diff) | |
download | meson-a024d75e150334330954bf7a6fdbe8cb02a82491.zip meson-a024d75e150334330954bf7a6fdbe8cb02a82491.tar.gz meson-a024d75e150334330954bf7a6fdbe8cb02a82491.tar.bz2 |
backends: add a new "none" backend
It can only be used for projects that don't have any rules at all, i.e.
they are purely using Meson to:
- configure files
- run (script?) tests
- install files that exist by the end of the setup stage
This can be useful e.g. for Meson itself, a pure python project.
Diffstat (limited to 'mesonbuild/backend/nonebackend.py')
-rw-r--r-- | mesonbuild/backend/nonebackend.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mesonbuild/backend/nonebackend.py b/mesonbuild/backend/nonebackend.py new file mode 100644 index 0000000..cf7c3dd --- /dev/null +++ b/mesonbuild/backend/nonebackend.py @@ -0,0 +1,31 @@ +# Copyright 2022 The Meson development team + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from __future__ import annotations + +from .backends import Backend +from .. import mlog +from ..mesonlib import MesonBugException + + +class NoneBackend(Backend): + + name = 'none' + + def generate(self): + if self.build.get_targets(): + raise MesonBugException('None backend cannot generate target rules, but should have failed earlier.') + mlog.log('Generating simple install-only backend') + self.serialize_tests() + self.create_install_data_files() |