Last active
October 24, 2023 14:19
-
-
Save tkersey/30f7dd82899fbdac25eea159b1d4d794 to your computer and use it in GitHub Desktop.
Package.swift Settings
This file contains hidden or 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
extension LinkerSetting { | |
static var mergeable: Self = unsafeFlags([ | |
"-Wl,-make_mergeable", | |
"-Wl,-no_exported_symbols", | |
]) | |
} |
This file contains hidden or 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
extension SwiftSetting { | |
static func warnLongExpressionTypeChecking( | |
typeChecking: Int = 200, | |
functionBodies: Int = 200, | |
for configuration: BuildConfiguration = .debug | |
) -> Self { | |
unsafeFlags( | |
[ | |
"-Xfrontend", "-warn-long-expression-type-checking=\(typeChecking)", | |
"-Xfrontend", "-warn-long-function-bodies=\(functionBodies)", | |
], | |
.when(configuration: configuration) | |
) | |
} | |
enum ConcurrencyChecking: String { | |
case complete | |
case minimal | |
case targeted | |
} | |
static func concurrencyChecking( | |
_ setting: ConcurrencyChecking = .complete, | |
for configuration: BuildConfiguration = .debug | |
) -> Self { | |
.unsafeFlags( | |
[ | |
"-Xfrontend", "-strict-concurrency=\(setting)", | |
"-Xfrontend", "-warn-concurrency", | |
"-Xfrontend", "-enable-actor-data-race-checks", | |
], | |
.when(configuration: configuration) | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment