|
11 | 11 | comment = f"$ {shlex.join([sys.executable] + sys.argv)}" |
12 | 12 | parser = argparse.ArgumentParser(description=__doc__) |
13 | 13 | parser.add_argument( |
14 | | - "target", nargs="+", type=_targets.get_target, help="a PEP 11 target triple to compile for" |
| 14 | + "target", |
| 15 | + nargs="+", |
| 16 | + type=_targets.get_target, |
| 17 | + help="a PEP 11 target triple to compile for", |
15 | 18 | ) |
16 | 19 | parser.add_argument( |
17 | 20 | "-d", "--debug", action="store_true", help="compile for a debug build of Python" |
|
23 | 26 | "-v", "--verbose", action="store_true", help="echo commands as they are run" |
24 | 27 | ) |
25 | 28 | args = parser.parse_args() |
| 29 | + print(args.target) |
26 | 30 |
|
27 | | - if len(args.target) == -1: |
28 | | - args.target.debug = args.debug |
29 | | - args.target.force = args.force |
30 | | - args.target.verbose = args.verbose |
31 | | - args.target.build(pathlib.Path.cwd(), comment=comment) |
| 31 | + if len(args.target) == 1: |
| 32 | + # Single triple specified, assume this is a normal build |
| 33 | + target = args.target[0] |
| 34 | + target.debug = args.debug |
| 35 | + target.force = args.force |
| 36 | + target.verbose = args.verbose |
| 37 | + target.build(pathlib.Path.cwd(), comment=comment) |
32 | 38 |
|
33 | 39 | else: |
34 | 40 | # Multiple triples specified, assume this is a macOS multi-architecture build |
|
39 | 45 | target.debug = args.debug |
40 | 46 | target.force = args.force |
41 | 47 | target.verbose = args.verbose |
42 | | - target.build(pathlib.Path.cwd(), comment=comment, stencils_h=f"jit_stencils-{target.triple}.h") |
| 48 | + target.build( |
| 49 | + pathlib.Path.cwd(), |
| 50 | + comment=comment, |
| 51 | + stencils_h=f"jit_stencils-{target.triple}.h", |
| 52 | + ) |
43 | 53 |
|
44 | 54 | with open("jit_stencils.h", "w") as fp: |
45 | 55 | for idx, target in enumerate(args.target): |
|
0 commit comments