]> git.saurik.com Git - wxWidgets.git/blame - docs/doxygen/scripts/make_bindings.py
remove support/detection of Mac OS < X
[wxWidgets.git] / docs / doxygen / scripts / make_bindings.py
CommitLineData
4e735ed6
KO
1import doxymlparser
2import optparse
3import sys
4import os
5import string
0cbc1d02
KO
6import sip_tools
7import swig_tools
4e735ed6
KO
8import types
9
0cbc1d02
KO
10from common import *
11
4e735ed6
KO
12option_dict = {
13 "output_dir" : ("output", "Directory to output bindings to"),
14 "sip" : (True, "Produce SIP bindings"),
15 "swig" : (True, "Produce SWIG bindings."),
16
17}
18
4e735ed6
KO
19parser = optparse.OptionParser(usage="usage: %prog <doxyml files to parse>\n" , version="%prog 1.0")
20
21for opt in option_dict:
22 default = option_dict[opt][0]
23
24 action = "store"
25 if type(default) == types.BooleanType:
26 action = "store_true"
27 parser.add_option("--" + opt, default=default, action=action, dest=opt, help=option_dict[opt][1])
28
29options, arguments = parser.parse_args()
30
4e735ed6
KO
31if __name__ == "__main__":
32 if len(arguments) < 1:
33 parser.print_usage()
34 sys.exit(1)
35
36 doxyparse = doxymlparser.DoxyMLParser()
37 for arg in arguments:
38 doxyparse.parse(arg)
39
40 if options.sip:
0cbc1d02 41 builder = sip_tools.SIPBuilder(doxyparse, options.output_dir)
4e735ed6
KO
42 builder.make_bindings()
43
44 if options.swig:
0cbc1d02 45 builder = swig_tools.SWIGBuilder(doxyparse, options.output_dir)
4e735ed6 46 builder.make_bindings()