diff --git a/Meta/find_compiler.py b/Meta/find_compiler.py index e2814934ac3..c67b197d1b4 100755 --- a/Meta/find_compiler.py +++ b/Meta/find_compiler.py @@ -180,9 +180,11 @@ def pick_swift_compilers(platform: Platform, project_root: Path) -> tuple[Path, swiftly_toolchain_path = run_command(["swiftly", "use", "--print-location"], return_output=True, cwd=project_root) if not swiftly_toolchain_path: run_command(["swiftly", "install"], exit_on_failure=True, cwd=project_root) + swiftly_toolchain_path = run_command( ["swiftly", "use", "--print-location"], return_output=True, exit_on_failure=True, cwd=project_root ) + assert swiftly_toolchain_path swiftly_toolchain_path = Path(swiftly_toolchain_path.strip()) swiftly_bin_dir = swiftly_toolchain_path.joinpath("usr", "bin") diff --git a/Meta/ladybird.py b/Meta/ladybird.py index 67278329a87..9511b1f129d 100755 --- a/Meta/ladybird.py +++ b/Meta/ladybird.py @@ -183,9 +183,12 @@ def configure_main(platform: Platform, preset: str, cc: str, cxx: str) -> Path: if build_preset_dir.joinpath("build.ninja").exists() or build_preset_dir.joinpath("ladybird.sln").exists(): return build_preset_dir + switfc: Optional[str] = None validate_cmake_version() + if "Swift" in preset: - (cc, cxx, swiftc) = pick_swift_compilers(platform, ladybird_source_dir) + compilers = pick_swift_compilers(platform, ladybird_source_dir) + (cc, cxx, swiftc) = tuple(map(str, compilers)) else: (cc, cxx) = pick_host_compiler(platform, cc, cxx) @@ -201,7 +204,7 @@ def configure_main(platform: Platform, preset: str, cc: str, cxx: str) -> Path: f"-DCMAKE_CXX_COMPILER={cxx}", ] - if "Swift" in preset: + if switfc: config_args.append(f"-DCMAKE_Swift_COMPILER={swiftc}") if platform.host_system == HostSystem.Linux and platform.host_architecture == HostArchitecture.AArch64: