aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/coredata.py14
-rw-r--r--mesonbuild/environment.py13
-rw-r--r--mesonbuild/msetup.py1
3 files changed, 19 insertions, 9 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 5796377..0a541cc 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -31,6 +31,7 @@ from typing import (
)
import typing
import enum
+import shlex
if typing.TYPE_CHECKING:
from . import dependencies
@@ -776,6 +777,9 @@ def get_cmd_line_file(build_dir):
def read_cmd_line_file(build_dir, options):
filename = get_cmd_line_file(build_dir)
+ if not os.path.isfile(filename):
+ return
+
config = CmdLineFileParser()
config.read(filename)
@@ -816,6 +820,16 @@ def update_cmd_line_file(build_dir, options):
with open(filename, 'w') as f:
config.write(f)
+def get_cmd_line_options(build_dir, options):
+ copy = argparse.Namespace(**vars(options))
+ read_cmd_line_file(build_dir, copy)
+ cmdline = ['-D{}={}'.format(k, v) for k, v in copy.cmd_line_options.items()]
+ if options.cross_file:
+ cmdline += ['--cross-file {}'.format(f) for f in options.cross_file]
+ if options.native_file:
+ cmdline += ['--native-file {}'.format(f) for f in options.native_file]
+ return ' '.join([shlex.quote(x) for x in cmdline])
+
def major_versions_differ(v1, v2):
return v1.split('.')[0:2] != v2.split('.')[0:2]
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 8a13b5e..42524a8 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -173,8 +173,6 @@ def detect_scanbuild():
named "scan-build". However, some distribution's package manager (FreeBSD)
don't. For those, loop through a list of candidates to see if one is
available.
- Since this is a costly operation, limit it to the impacted platforms
- (currently all non-linux platforms)
Return: a single-element list of the found scan-build binary ready to be
passed to Popen()
@@ -183,14 +181,11 @@ def detect_scanbuild():
if 'SCANBUILD' in os.environ:
exelist = split_args(os.environ['SCANBUILD'])
- elif shutil.which('scan-build') is not None:
- exelist = [shutil.which('scan-build')]
-
- elif platform.system() != 'Linux':
+ else:
tools = [
'scan-build', # base
- 'scan-build-8.0', 'scan-build80',
- 'scan-build-7.0', 'scan-build70',
+ 'scan-build-8', 'scan-build80',
+ 'scan-build-7', 'scan-build70',
'scan-build-6.0', 'scan-build60',
'scan-build-5.0', 'scan-build50',
'scan-build-4.0', 'scan-build40',
@@ -199,7 +194,7 @@ def detect_scanbuild():
'scan-build-3.7', 'scan-build37',
'scan-build-3.6', 'scan-build36',
'scan-build-3.5', 'scan-build35',
- 'scan-build-9.0', 'scan-build-devel', # development snapshot
+ 'scan-build-9', 'scan-build-devel', # development snapshot
]
for tool in tools:
if shutil.which(tool) is not None:
diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py
index 13df6ea..e06a803 100644
--- a/mesonbuild/msetup.py
+++ b/mesonbuild/msetup.py
@@ -161,6 +161,7 @@ class MesonApp:
def _generate(self, env):
mlog.debug('Build started at', datetime.datetime.now().isoformat())
mlog.debug('Main binary:', sys.executable)
+ mlog.debug('Build Options:', coredata.get_cmd_line_options(self.build_dir, self.options))
mlog.debug('Python system:', platform.system())
mlog.log(mlog.bold('The Meson build system'))
mlog.log('Version:', coredata.version)