Put compiler options to introspection output.

pull/275/head
Jussi Pakkanen 9 years ago
parent 9a4016d37a
commit d32af67e68
  1. 15
      mesonintrospect.py

@ -22,7 +22,7 @@ Currently only works for the Ninja backend. Others use generated
project files and don't need this info.""" project files and don't need this info."""
import json, pickle import json, pickle
import coredata, build, optinterpreter import coredata, build, mesonlib
import argparse import argparse
import sys, os import sys, os
@ -107,7 +107,11 @@ def list_buildoptions(coredata, builddata):
'description' : 'Unity build', 'description' : 'Unity build',
'name' : 'unity'} 'name' : 'unity'}
optlist = [buildtype, strip, coverage, pch, unity] optlist = [buildtype, strip, coverage, pch, unity]
options = coredata.user_options add_keys(optlist, coredata.user_options)
add_keys(optlist, coredata.compiler_options)
print(json.dumps(optlist))
def add_keys(optlist, options):
keys = list(options.keys()) keys = list(options.keys())
keys.sort() keys.sort()
for key in keys: for key in keys:
@ -115,11 +119,11 @@ def list_buildoptions(coredata, builddata):
optdict = {} optdict = {}
optdict['name'] = key optdict['name'] = key
optdict['value'] = opt.value optdict['value'] = opt.value
if isinstance(opt, optinterpreter.UserStringOption): if isinstance(opt, mesonlib.UserStringOption):
typestr = 'string' typestr = 'string'
elif isinstance(opt, optinterpreter.UserBooleanOption): elif isinstance(opt, mesonlib.UserBooleanOption):
typestr = 'boolean' typestr = 'boolean'
elif isinstance(opt, optinterpreter.UserComboOption): elif isinstance(opt, mesonlib.UserComboOption):
optdict['choices'] = opt.choices optdict['choices'] = opt.choices
typestr = 'combo' typestr = 'combo'
else: else:
@ -127,7 +131,6 @@ def list_buildoptions(coredata, builddata):
optdict['type'] = typestr optdict['type'] = typestr
optdict['description'] = opt.description optdict['description'] = opt.description
optlist.append(optdict) optlist.append(optdict)
print(json.dumps(optlist))
def list_buildsystem_files(coredata, builddata): def list_buildsystem_files(coredata, builddata):
src_dir = builddata.environment.get_source_dir() src_dir = builddata.environment.get_source_dir()

Loading…
Cancel
Save