Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only link static libraries to executables
- Loading branch information
1 parent
6cf3359
commit 0afd705
Showing
9 changed files
with
251 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import Foundation | ||
|
||
public enum Linkage { | ||
case dynamic | ||
case `static` | ||
case none | ||
} | ||
|
||
extension Target { | ||
|
||
public var defaultLinkage: Linkage { | ||
switch type { | ||
case .none, | ||
.appExtension, | ||
.application, | ||
.bundle, | ||
.commandLineTool, | ||
.messagesApplication, | ||
.messagesExtension, | ||
.ocUnitTestBundle, | ||
.stickerPack, | ||
.tvExtension, | ||
.uiTestBundle, | ||
.unitTestBundle, | ||
.watchApp, | ||
.watchExtension, | ||
.watch2App, | ||
.watch2Extension, | ||
.xcodeExtension, | ||
.xpcService: | ||
return .none | ||
case .framework: | ||
// TODO: This should check `MACH_O_TYPE` in case this is a "Static Framework" | ||
return .dynamic | ||
case .dynamicLibrary: | ||
return .dynamic | ||
case .staticLibrary: | ||
return .static | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.