Debian Codegraph @

mesonbuild/backend/nonebackend.py

raw
1 # SPDX-License-Identifier: Apache-2.0
2 # Copyright 2022 The Meson development team
3
4 from __future__ import annotations
5 import typing as T
6
7 from .backends import Backend
8 from .. import mlog
9 from ..mesonlib import MesonBugException
10
11
12 class NoneBackend(Backend):
13
14 name = 'none'
15
16 def generate(self, capture: bool = False, vslite_ctx: T.Optional[T.Dict] = None) -> None:
17 # Check for (currently) unexpected capture arg use cases -
18 if capture:
19 raise MesonBugException('We do not expect the none backend to generate with \'capture = True\'')
20 if vslite_ctx:
21 raise MesonBugException('We do not expect the none backend to be given a valid \'vslite_ctx\'')
22
23 if self.build.get_targets():
24 raise MesonBugException('None backend cannot generate target rules, but should have failed earlier.')
25 mlog.log('Generating simple install-only backend')
26 self.serialize_tests()
27 self.create_install_data_files()