Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build executables one by one #256

Merged
merged 1 commit into from
Dec 22, 2022
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
32 changes: 16 additions & 16 deletions Sources/MintKit/Mint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -330,24 +330,24 @@ public class Mint {
throw MintError.missingExecutable(package)
}

var buildCommand = "swift build -c release"
for executable in executables {
buildCommand += " --product \(executable)"
}
#if os(macOS)
let processInfo = ProcessInfo.processInfo
if let machineHardwareName = processInfo.machineHardwareName {
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
let target = "\(machineHardwareName)-apple-macosx\(osVersion.majorVersion).\(osVersion.minorVersion)"
buildCommand += " -Xswiftc -target -Xswiftc \(target)"
}
#endif
var buildCommand = "swift build -c release --product \(executable)"

#if os(macOS)
let processInfo = ProcessInfo.processInfo
if let machineHardwareName = processInfo.machineHardwareName {
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
let target = "\(machineHardwareName)-apple-macosx\(osVersion.majorVersion).\(osVersion.minorVersion)"
buildCommand += " -Xswiftc -target -Xswiftc \(target)"
}
#endif

try runPackageCommand(name: "Building package",
command: buildCommand,
directory: packageCheckoutPath,
stdOutOnError: true,
error: .packageBuildError(package))
try runPackageCommand(name: "Building product \(executable)",
command: buildCommand,
directory: packageCheckoutPath,
stdOutOnError: true,
error: .packageBuildError(package))
}

let packageBuildPath = packageCheckoutPath + ".build/release"
let packageInstallPath = packagePath.installPath
Expand Down