From 67d3d512ffae9de255c6954451c59816ae8faea9 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 3 Feb 2017 15:53:20 +0530 Subject: mesonintrospect: Also print builtins for --buildoptions This is needed to be able to introspect the value of xxxdir options such as libdir and prefix. --- mesonbuild/mintro.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'mesonbuild/mintro.py') diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index e30500f..2807230 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -111,23 +111,11 @@ def list_target_files(target_name, coredata, builddata): print(json.dumps(sources)) def list_buildoptions(coredata, builddata): - buildtype = {'choices': ['plain', 'debug', 'debugoptimized', 'release', 'minsize'], - 'type': 'combo', - 'value': coredata.get_builtin_option('buildtype'), - 'description': 'Build type', - 'name': 'type'} - strip = {'value': coredata.get_builtin_option('strip'), - 'type': 'boolean', - 'description': 'Strip on install', - 'name': 'strip'} - unity = {'value': coredata.get_builtin_option('unity'), - 'type': 'boolean', - 'description': 'Unity build', - 'name': 'unity'} - optlist = [buildtype, strip, unity] + optlist = [] add_keys(optlist, coredata.user_options) add_keys(optlist, coredata.compiler_options) add_keys(optlist, coredata.base_options) + add_keys(optlist, coredata.builtins) print(json.dumps(optlist)) def add_keys(optlist, options): -- cgit v1.1 From b3d5db49e8a521b3a9545987546dec02babd88df Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 5 Feb 2017 05:18:08 +0530 Subject: mesonintrospect: Normalize install_filename in the output Without this, we can output a mixture of '/' and '\' on platforms where os.path.sep is '\' and prefix or outdir uses '/'. Let's always return the path in the format of the platform we're running on. This is needed to make the test_install_introspection() unittest work properly on Windows. --- mesonbuild/mintro.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mesonbuild/mintro.py') diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index 2807230..6eab76e 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -23,6 +23,7 @@ import json, pickle from . import coredata, build import argparse import sys, os +import pathlib parser = argparse.ArgumentParser() parser.add_argument('--targets', action='store_true', dest='list_targets', default=False, @@ -56,7 +57,9 @@ def determine_installed_path(target, installdata): fname = i[0] outdir = i[1] outname = os.path.join(installdata.prefix, outdir, os.path.split(fname)[-1]) - return outname + # Normalize the path by using os.path.sep consistently, etc. + # Does not change the effective path. + return str(pathlib.PurePath(outname)) def list_installed(installdata): -- cgit v1.1