Skip to content

Commit

Permalink
Build executables one by one (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentisambart authored Dec 22, 2022
1 parent 171b96f commit 526f662
Showing 1 changed file with 16 additions and 16 deletions.
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

0 comments on commit 526f662

Please sign in to comment.