Skip to content

Commit 58649ff

Browse files
Remove conditional and fix indentation in stencils
1 parent 467ffe1 commit 58649ff

File tree

1 file changed

+15
-24
lines changed

1 file changed

+15
-24
lines changed

Tools/jit/build.py

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,22 @@
2626
"-v", "--verbose", action="store_true", help="echo commands as they are run"
2727
)
2828
args = parser.parse_args()
29-
30-
if len(args.target) == 1:
31-
target = args.target[0]
29+
for target in args.target:
3230
target.debug = args.debug
31+
target.force = args.force
3332
target.verbose = args.verbose
34-
target.build(pathlib.Path.cwd(), comment=comment, force=args.force)
35-
36-
else:
37-
# Build for multiple targets (e.g. universal2)
38-
for target in args.target:
39-
target.debug = args.debug
40-
target.force = args.force
41-
target.verbose = args.verbose
42-
target.build(
43-
pathlib.Path.cwd(),
44-
comment=comment,
45-
stencils_h=f"jit_stencils-{target.triple}.h",
46-
force=args.force,
47-
)
33+
target.build(
34+
pathlib.Path.cwd(),
35+
comment=comment,
36+
stencils_h=f"jit_stencils-{target.triple}.h",
37+
force=args.force,
38+
)
4839

49-
with open("jit_stencils.h", "w") as fp:
50-
for idx, target in enumerate(args.target):
51-
fp.write(f"#{'if' if idx == 0 else 'elif'} {target.condition}\n")
52-
fp.write(f'# include "jit_stencils-{target.triple}.h"\n')
40+
with open("jit_stencils.h", "w") as fp:
41+
for idx, target in enumerate(args.target):
42+
fp.write(f"#{'if' if idx == 0 else 'elif'} {target.condition}\n")
43+
fp.write(f'#include "jit_stencils-{target.triple}.h"\n')
5344

54-
fp.write("#else\n")
55-
fp.write('# error "unexpected target"\n')
56-
fp.write("#endif\n")
45+
fp.write("#else\n")
46+
fp.write('#error "unexpected target"\n')
47+
fp.write("#endif\n")

0 commit comments

Comments
 (0)