Skip to content

Commit

Permalink
Add -a argument for passing parameters to the clang parser
Browse files Browse the repository at this point in the history
+ Remove -I arg, as it is redundant
  • Loading branch information
sdilts committed Feb 6, 2020
1 parent c17043c commit 1542244
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions cl_bindgen/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ def _add_args_to_option(option, args):
option = copy.copy(option)
if args.output:
option.output = args.output
if args.includes:
for item in args.includes:
option.arguments.append('-I')
option.arguments.append(item)
if args.arguments:
option.arguments.extend(args.arguments)
if args.package:
option.package = args.package
return option
Expand Down Expand Up @@ -115,16 +113,15 @@ def _build_parser():
metavar='output',
dest='output',
help="Specify where to place the generated output.")
process_parser.add_argument('-I',
metavar='include directories',
dest='includes',
default=[],
help="Specify include directories to be passed to libclang",
action='append')
process_parser.add_argument('-p',
metavar='package',
dest='package',
help="Output an in-package form with the given package at the top of the output")
process_parser.add_argument('-a', metavar='compiler arguments',
dest='arguments',
nargs=argparse.REMAINDER,
help='Consume the rest of the arguments and pass them to libclang')

process_parser.set_defaults(func=_arg_process_files)
return parser

Expand Down

0 comments on commit 1542244

Please sign in to comment.