summaryrefslogtreecommitdiff
path: root/giscanner
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2011-10-19 14:44:48 -0400
committerColin Walters <walters@verbum.org>2011-10-19 14:44:48 -0400
commit80de6648b5be315c9f2b73b3f04282e42517568e (patch)
tree194991d983cdb76194a9090803fab003087b8799 /giscanner
parentdf189c388b458475ac866715c7ff61a2d2cd7ccf (diff)
downloadgobject-introspection-80de6648b5be315c9f2b73b3f04282e42517568e.tar.gz
scanner: Support --header-only flag
This is useful for someone who just wants a set of constants from a .h file accessible by introspection.
Diffstat (limited to 'giscanner')
-rwxr-xr-xgiscanner/scannermain.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 6dc56ef0..bcacd0f6 100755
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -108,6 +108,9 @@ def _get_option_parser():
parser.add_option("-L", "--library-path",
action="append", dest="library_paths", default=[],
help="directories to search for libraries")
+ parser.add_option("", "--header-only",
+ action="store_true", dest="header_only", default=[],
+ help="If specified, just generate a GIR for the given header files")
parser.add_option("-n", "--namespace",
action="store", dest="namespace_name",
help=("name of namespace for this unit, also "
@@ -389,7 +392,9 @@ def scanner_main(args):
else:
_error("Unknown format: %s" % (options.format, ))
- if not (options.libraries or options.program):
+ if not (options.libraries
+ or options.program
+ or options.header_only):
_error("Must specify --program or --library")
namespace = create_namespace(options)
@@ -413,7 +418,10 @@ def scanner_main(args):
transformer.set_annotations(blocks)
transformer.parse(ss.get_symbols())
- shlibs = create_binary(transformer, options, args)
+ if not options.header_only:
+ shlibs = create_binary(transformer, options, args)
+ else:
+ shlibs = []
main = MainTransformer(transformer, blocks)
main.transform()