Commit ac031b8f authored by Drew's avatar Drew

Support deployment target

parent 06701cbe
...@@ -188,7 +188,18 @@ public enum Platform { ...@@ -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) { switch(self) {
case .OSX, .Linux, .iOSGeneric: case .OSX, .Linux, .iOSGeneric:
fatalError("Not implemented") fatalError("Not implemented")
...@@ -196,21 +207,13 @@ public enum Platform { ...@@ -196,21 +207,13 @@ public enum Platform {
case .iOS(let arch): case .iOS(let arch):
switch(arch) { switch(arch) {
case .x86_64: case .x86_64:
if Platform.isXcode7 {return "x86_64-apple-ios9.3"} return "x86_64-apple-ios"
return "x86_64-apple-ios10.0"
case .i386: case .i386:
if Platform.isXcode7 {return "i386-apple-ios9.3"} return "i386-apple-ios"
return "i386-apple-ios10.0"
case .arm64: case .arm64:
if Platform.isXcode7 {return "arm64-apple-ios9.3"} return "arm64-apple-ios"
return "arm64-apple-ios10.0"
case .armv7: case .armv7:
if Platform.isXcode7 {return "armv7-apple-ios9.3"} return "armv7-apple-ios"
return "armv7-apple-ios10.0"
} }
} }
......
...@@ -298,6 +298,7 @@ final class ATllbuild : Tool { ...@@ -298,6 +298,7 @@ final class ATllbuild : Tool {
case ExecutableName = "executable-name" case ExecutableName = "executable-name"
case Bitcode = "bitcode" case Bitcode = "bitcode"
case Magic = "magic" case Magic = "magic"
case DeploymentTarget = "deployment-target"
static var allOptions : [Options] { static var allOptions : [Options] {
...@@ -621,11 +622,21 @@ final class ATllbuild : Tool { ...@@ -621,11 +622,21 @@ final class ATllbuild : Tool {
compileOptions.append("-import-underlying-module") compileOptions.append("-import-underlying-module")
} }
//inject target //inject target
switch(Platform.targetPlatform) { switch(Platform.targetPlatform) {
case .iOS(let arch): 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) compileOptions.append(contentsOf: targetTuple)
linkOptions.append(contentsOf: targetTuple) linkOptions.append(contentsOf: targetTuple)
cCompileOptions.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