Create an API generator and corresponding generator options based on the requested target and command line options. This is encapsulated in a function so it can be profiled and/or timed. The args parameter is a parsed argument object containing the following fields that are used:
(args)
| 868 | |
| 869 | |
| 870 | def genTarget(args): |
| 871 | """Create an API generator and corresponding generator options based on |
| 872 | the requested target and command line options. |
| 873 | |
| 874 | This is encapsulated in a function so it can be profiled and/or timed. |
| 875 | The args parameter is a parsed argument object containing the following |
| 876 | fields that are used: |
| 877 | |
| 878 | - target - target to generate |
| 879 | - directory - directory to generate it in |
| 880 | - protect - True if re-inclusion wrappers should be created |
| 881 | - extensions - list of additional extensions to include in generated interfaces""" |
| 882 | |
| 883 | # Create generator options with parameters specified on command line |
| 884 | makeGenOpts(args) |
| 885 | |
| 886 | # Select a generator matching the requested target |
| 887 | if args.target in genOpts: |
| 888 | createGenerator = genOpts[args.target][0] |
| 889 | options = genOpts[args.target][1] |
| 890 | |
| 891 | logDiag('* Building', options.filename) |
| 892 | logDiag('* options.apiname =', options.apiname) |
| 893 | logDiag('* options.versions =', options.versions) |
| 894 | logDiag('* options.emitversions =', options.emitversions) |
| 895 | logDiag('* options.defaultExtensions =', options.defaultExtensions) |
| 896 | logDiag('* options.addExtensions =', options.addExtensions) |
| 897 | logDiag('* options.removeExtensions =', options.removeExtensions) |
| 898 | logDiag('* options.emitExtensions =', options.emitExtensions) |
| 899 | logDiag('* options.emitSpirv =', options.emitSpirv) |
| 900 | logDiag('* options.emitFormats =', options.emitFormats) |
| 901 | |
| 902 | gen = createGenerator(errFile=errWarn, |
| 903 | warnFile=errWarn, |
| 904 | diagFile=diag) |
| 905 | return (gen, options) |
| 906 | else: |
| 907 | logErr('No generator options for unknown target:', args.target) |
| 908 | return None |
| 909 | |
| 910 | |
| 911 | # -feature name |
no test coverage detected