INNER CODE UNIT · Python
built
wasm3/wasm3 · extra/check.py:55
def built(args, name):
"""Locate an executable the build stage produced.
Single-config generators put it straight in the build tree; Visual Studio and Xcode
add a per-configuration directory. Searching both beats asking the caller which
generator configured a tree they may not have configured themselves.
"""
for d in (
args.build_dir,
os.path.join(args.build_dir, "Release"),
os.path.join(args.build_dir, "Debug"),
):
for exe in (name, name + ".exe"):
path = os.path.join(d, exe)
if os.path.isfile(path):
return os.path.abspath(path)
raise StageError(f"no {name} in {args.build_dir} -- run the build stage first")