v2.3.3 release: cross-platform driver in docs (makeDefaultAudioDriver)
This commit is contained in:
@@ -253,9 +253,15 @@ def modules_dir(root: Path) -> Path:
|
||||
proc = subprocess.run(["swift", "build", "--show-bin-path"], cwd=root,
|
||||
capture_output=True, text=True)
|
||||
if proc.returncode == 0 and proc.stdout.strip():
|
||||
d = Path(proc.stdout.strip()) / "Modules"
|
||||
bin_dir = Path(proc.stdout.strip())
|
||||
d = bin_dir / "Modules"
|
||||
if d.is_dir():
|
||||
return d
|
||||
# Newer SwiftPM build layouts (e.g. .build/out/Products/Debug) drop the
|
||||
# Modules/ subdir and place the .swiftmodule bundles directly in the bin
|
||||
# dir. Use the bin dir itself as the import search path in that case.
|
||||
if any(bin_dir.glob("*.swiftmodule")):
|
||||
return bin_dir
|
||||
raise RuntimeError("could not locate the built Modules dir; run `swift build` first")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user