Commit 3be3b75e authored by Drew's avatar Drew

Support deployment target for OSX

parent fbabbe31
......@@ -255,7 +255,9 @@ public enum Platform {
var standardDeploymentTarget: String {
switch(self) {
case .OSX, .Linux, .iOSGeneric:
case .OSX:
return "10.12"
case .Linux, .iOSGeneric:
fatalError("Not implemented")
case .iOS:
......@@ -266,7 +268,9 @@ public enum Platform {
var nonDeploymentTargetTargetTriple: String {
switch(self) {
case .OSX, .Linux, .iOSGeneric:
case .OSX:
return "x86_64-apple-macosx"
case .Linux, .iOSGeneric:
fatalError("Not implemented")
case .iOS(let arch):
......
......@@ -326,7 +326,8 @@ final class ATllbuild : Tool {
Framework,
ExecutableName,
Bitcode,
Magic
Magic,
DeploymentTarget
]
}
}
......@@ -643,9 +644,24 @@ final class ATllbuild : Tool {
cCompileOptions.append(contentsOf: targetTuple)
cCompileOptions.append(contentsOf: ["-isysroot",Platform.targetPlatform.sdkPath!])
linkOptions.append(contentsOf: ["-Xlinker", "-syslibroot","-Xlinker",Platform.targetPlatform.sdkPath!])
case .OSX:
//we require sysroot
cCompileOptions.append(contentsOf: ["-isysroot",Platform.targetPlatform.sdkPath!])
//we require sysroot
cCompileOptions.append(contentsOf: ["-isysroot",Platform.targetPlatform.sdkPath!])
//deployment target
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)
case .Linux:
break //not required
......
......@@ -19,10 +19,10 @@ commands:
module-name: platforms
module-output-path: .atllbuild/products/platforms.swiftmodule
temps-path: .atllbuild/llbuildtmp
other-args: ["-j8", "-D", "ATBUILD", "-I", ".atllbuild/products/", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk", "-D", "OSX", "-g", "-DATBUILD_DEBUG"]
other-args: ["-j8", "-D", "ATBUILD", "-I", ".atllbuild/products/", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk", "-D", "OSX", "-target", "x86_64-apple-macosx10.12", "-g", "-DATBUILD_DEBUG"]
<atllbuild>:
tool: shell
inputs: ["<atllbuild-swiftc>", ".atllbuild/objects/main.swift.o"]
outputs: ["<atllbuild>", ".atllbuild/products/platforms"]
args: ["/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc", "-o", ".atllbuild/products/platforms", ".atllbuild/objects/main.swift.o"]
args: ["/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/swiftc", "-o", ".atllbuild/products/platforms", ".atllbuild/objects/main.swift.o", "-target", "x86_64-apple-macosx10.12"]
description: Linking executable .atllbuild/products/platforms
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