|
|
@@ -270,7 +270,16 @@ def setup_swift_builder(env, apple_platform, sdk_path, current_path, bridging_he
|
|
|
|
|
|
env["ALL_SWIFT_FILES"] = all_swift_files
|
|
|
env["CURRENT_PATH"] = current_path
|
|
|
- frontend_path = "$APPLE_TOOLCHAIN_PATH/usr/bin/swift-frontend"
|
|
|
+ if "SWIFT_FRONTEND" in env and env["SWIFT_FRONTEND"] != "":
|
|
|
+ frontend_path = env["SWIFT_FRONTEND"]
|
|
|
+ elif "osxcross" not in env:
|
|
|
+ frontend_path = "$APPLE_TOOLCHAIN_PATH/usr/bin/swift-frontend"
|
|
|
+ else:
|
|
|
+ frontend_path = None
|
|
|
+
|
|
|
+ if frontend_path is None:
|
|
|
+ raise Exception("Swift frontend path is not set. Please set SWIFT_FRONTEND.")
|
|
|
+
|
|
|
bridging_header_path = current_path + "/" + bridging_header_filename
|
|
|
env["SWIFTC"] = frontend_path + " -frontend -c" # Swift compiler
|
|
|
env["SWIFTCFLAGS"] = [
|
|
|
@@ -290,6 +299,14 @@ def setup_swift_builder(env, apple_platform, sdk_path, current_path, bridging_he
|
|
|
"-I./", # Pass the current directory as the header root so bridging headers can include files from any point of the hierarchy
|
|
|
]
|
|
|
|
|
|
+ if "osxcross" in env:
|
|
|
+ env.Append(
|
|
|
+ SWIFTCFLAGS=[
|
|
|
+ "-resource-dir",
|
|
|
+ "/root/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift",
|
|
|
+ ]
|
|
|
+ )
|
|
|
+
|
|
|
if env["debug_symbols"]:
|
|
|
env.Append(SWIFTCFLAGS=["-g"])
|
|
|
|