diff options
-rwxr-xr-x | giscanner/scannermain.py | 12 | ||||
-rw-r--r-- | tests/scanner/Makefile.am | 5 |
2 files changed, 14 insertions, 3 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() diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am index 0b287091..38e1cd04 100644 --- a/tests/scanner/Makefile.am +++ b/tests/scanner/Makefile.am @@ -115,7 +115,10 @@ Bar_1_0_gir_SCANNERFLAGS = --accept-unprefixed GIRS += Bar-1.0.gir endif +Headeronly-1.0.gir: headeronly.h + $(AM_V_GEN) $(INTROSPECTION_SCANNER) $(INTROSPECTION_SCANNER_ARGS) --warn-all --warn-error --reparse-validate --namespace=Headeronly --nsversion=1.0 --header-only --output=$@ $< + %.gir.check: %.gir @diff -u -U 10 $(srcdir)/$*-expected.gir $*.gir && echo " TEST $*.gir" -check-local: $(CHECKGIRS) $(TYPELIBS) +check-local: Headeronly-1.0.gir $(CHECKGIRS) $(TYPELIBS) |