Commit ac031b8f authored by Drew's avatar Drew

Support deployment target

parent 06701cbe
......@@ -188,7 +188,18 @@ public enum Platform {
}
}
var targetTriple: String {
var standardDeploymentTarget: String {
switch(self) {
case .OSX, .Linux, .iOSGeneric:
fatalError("Not implemented")
case .iOS:
if Platform.isXcode7 { return "9.3" }
return "10.0"
}
}
var nonDeploymentTargetTargetTriple: String {
switch(self) {
case .OSX, .Linux, .iOSGeneric:
fatalError("Not implemented")
......@@ -196,21 +207,13 @@ public enum Platform {
case .iOS(let arch):
switch(arch) {
case .x86_64:
if Platform.isXcode7 {return "x86_64-apple-ios9.3"}
return "x86_64-apple-ios10.0"
return "x86_64-apple-ios"
case .i386:
if Platform.isXcode7 {return "i386-apple-ios9.3"}
return "i386-apple-ios10.0"
return "i386-apple-ios"
case .arm64:
if Platform.isXcode7 {return "arm64-apple-ios9.3"}
return "arm64-apple-ios10.0"
return "arm64-apple-ios"
case .armv7:
if Platform.isXcode7 {return "armv7-apple-ios9.3"}
return "armv7-apple-ios10.0"
return "armv7-apple-ios"
}
}
......
......@@ -298,6 +298,7 @@ final class ATllbuild : Tool {
case ExecutableName = "executable-name"
case Bitcode = "bitcode"
case Magic = "magic"
case DeploymentTarget = "deployment-target"
static var allOptions : [Options] {
......@@ -621,11 +622,21 @@ final class ATllbuild : Tool {
compileOptions.append("-import-underlying-module")
}
//inject target
switch(Platform.targetPlatform) {
case .iOS(let arch):
let targetTuple = ["-target",Platform.targetPlatform.targetTriple]
let deploymentTarget: String
if let _deploymentTarget = task[Options.DeploymentTarget.rawValue]?.string {
deploymentTarget = _deploymentTarget
}
else {
deploymentTarget = Platform.targetPlatform.standardDeploymentTarget
}
let targetTuple = ["-target",Platform.targetPlatform.nonDeploymentTargetTargetTriple + deploymentTarget]
compileOptions.append(contentsOf: targetTuple)
linkOptions.append(contentsOf: targetTuple)
cCompileOptions.append(contentsOf: targetTuple)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment