|
|
@ -31,7 +31,7 @@ from . import mintro |
|
|
|
from .mconf import make_lower_case |
|
|
|
from .mconf import make_lower_case |
|
|
|
from .mesonlib import MesonException |
|
|
|
from .mesonlib import MesonException |
|
|
|
|
|
|
|
|
|
|
|
def add_arguments(parser): |
|
|
|
def add_arguments(parser: argparse.ArgumentParser) -> None: |
|
|
|
coredata.register_builtin_arguments(parser) |
|
|
|
coredata.register_builtin_arguments(parser) |
|
|
|
parser.add_argument('--native-file', |
|
|
|
parser.add_argument('--native-file', |
|
|
|
default=[], |
|
|
|
default=[], |
|
|
@ -59,7 +59,7 @@ def add_arguments(parser): |
|
|
|
parser.add_argument('sourcedir', nargs='?', default=None) |
|
|
|
parser.add_argument('sourcedir', nargs='?', default=None) |
|
|
|
|
|
|
|
|
|
|
|
class MesonApp: |
|
|
|
class MesonApp: |
|
|
|
def __init__(self, options): |
|
|
|
def __init__(self, options: argparse.Namespace) -> None: |
|
|
|
(self.source_dir, self.build_dir) = self.validate_dirs(options.builddir, |
|
|
|
(self.source_dir, self.build_dir) = self.validate_dirs(options.builddir, |
|
|
|
options.sourcedir, |
|
|
|
options.sourcedir, |
|
|
|
options.reconfigure, |
|
|
|
options.reconfigure, |
|
|
@ -150,7 +150,7 @@ class MesonApp: |
|
|
|
raise SystemExit('Directory does not contain a valid build tree:\n{}'.format(build_dir)) |
|
|
|
raise SystemExit('Directory does not contain a valid build tree:\n{}'.format(build_dir)) |
|
|
|
return src_dir, build_dir |
|
|
|
return src_dir, build_dir |
|
|
|
|
|
|
|
|
|
|
|
def generate(self): |
|
|
|
def generate(self) -> None: |
|
|
|
env = environment.Environment(self.source_dir, self.build_dir, self.options) |
|
|
|
env = environment.Environment(self.source_dir, self.build_dir, self.options) |
|
|
|
mlog.initialize(env.get_log_dir(), self.options.fatal_warnings) |
|
|
|
mlog.initialize(env.get_log_dir(), self.options.fatal_warnings) |
|
|
|
if self.options.profile: |
|
|
|
if self.options.profile: |
|
|
@ -158,7 +158,7 @@ class MesonApp: |
|
|
|
with mesonlib.BuildDirLock(self.build_dir): |
|
|
|
with mesonlib.BuildDirLock(self.build_dir): |
|
|
|
self._generate(env) |
|
|
|
self._generate(env) |
|
|
|
|
|
|
|
|
|
|
|
def _generate(self, env): |
|
|
|
def _generate(self, env: environment.Environment) -> None: |
|
|
|
mlog.debug('Build started at', datetime.datetime.now().isoformat()) |
|
|
|
mlog.debug('Build started at', datetime.datetime.now().isoformat()) |
|
|
|
mlog.debug('Main binary:', sys.executable) |
|
|
|
mlog.debug('Main binary:', sys.executable) |
|
|
|
mlog.debug('Build Options:', coredata.get_cmd_line_options(self.build_dir, self.options)) |
|
|
|
mlog.debug('Build Options:', coredata.get_cmd_line_options(self.build_dir, self.options)) |
|
|
@ -239,7 +239,7 @@ class MesonApp: |
|
|
|
os.unlink(cdf) |
|
|
|
os.unlink(cdf) |
|
|
|
raise |
|
|
|
raise |
|
|
|
|
|
|
|
|
|
|
|
def run(options) -> int: |
|
|
|
def run(options: argparse.Namespace) -> int: |
|
|
|
coredata.parse_cmd_line_options(options) |
|
|
|
coredata.parse_cmd_line_options(options) |
|
|
|
app = MesonApp(options) |
|
|
|
app = MesonApp(options) |
|
|
|
app.generate() |
|
|
|
app.generate() |
|
|
|