Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Sources/SwiftBuildSupport/SwiftBuildSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,16 @@ public final class SwiftBuildSystem: SPMBuildCore.BuildSystem {
}
}

// FIXME: "none" triples get a placeholder SDK/platform and don't support any specific triple by default. Unlike most platforms, where the vendor and environment is implied as a function of the arch and "platform", bare metal operates in terms of triples directly. We need to replace this bringup convenience with a more idiomatic mechanism, perhaps in the build request.
if buildParameters.triple.os == .noneOS {
settings["ARCHS"] = buildParameters.triple.archName
settings["VALID_ARCHS"] = buildParameters.triple.archName
settings["LLVM_TARGET_TRIPLE_VENDOR"] = buildParameters.triple.vendorName
if !buildParameters.triple.environmentName.isEmpty {
settings["LLVM_TARGET_TRIPLE_SUFFIX"] = "-" + buildParameters.triple.environmentName
}
}

settings["LIBRARY_SEARCH_PATHS"] = try "$(inherited) \(buildParameters.toolchain.toolchainLibDir.pathString)"
settings["OTHER_CFLAGS"] = (
["$(inherited)"]
Expand Down