Skip to content

Commit b28fdca

Browse files
committed
Build: Fix container build path for swift
1 parent 06827c9 commit b28fdca

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

platform_methods.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ def setup_swift_builder(env, apple_platform, sdk_path, current_path, bridging_he
270270

271271
env["ALL_SWIFT_FILES"] = all_swift_files
272272
env["CURRENT_PATH"] = current_path
273-
frontend_path = "$APPLE_TOOLCHAIN_PATH/usr/bin/swift-frontend"
273+
if env["osxcross"]:
274+
# TODO: swiftly use --print-location
275+
frontend_path = "/root/.local/share/swiftly/toolchains/6.2.0/usr/bin/swift-frontend"
276+
else:
277+
frontend_path = "$APPLE_TOOLCHAIN_PATH/usr/bin/swift-frontend"
274278
bridging_header_path = current_path + "/" + bridging_header_filename
275279
env["SWIFTC"] = frontend_path + " -frontend -c" # Swift compiler
276280
env["SWIFTCFLAGS"] = [
@@ -290,6 +294,14 @@ def setup_swift_builder(env, apple_platform, sdk_path, current_path, bridging_he
290294
"-I./", # Pass the current directory as the header root so bridging headers can include files from any point of the hierarchy
291295
]
292296

297+
if "osxcross" in env:
298+
env.Append(
299+
SWIFTCFLAGS=[
300+
"-resource-dir",
301+
"/root/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift",
302+
]
303+
)
304+
293305
if env["debug_symbols"]:
294306
env.Append(SWIFTCFLAGS=["-g"])
295307

0 commit comments

Comments
 (0)