Skip to content

Commit

Permalink
Guard swift settings and dependencies for FreeBSD behind a `isFreeBSD…
Browse files Browse the repository at this point in the history
…` boolean

`Platform.freebsd` is not yet available on swift-pm. Therefore we guard the
settings and dependencies behind a `isFreeBSD` boolean instead.
  • Loading branch information
michael-yuji committed Dec 16, 2024
1 parent ead76e7 commit 728cff7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ import PackageDescription
// To develop this on Apple platforms, set this to true
let development = false

// Ideally, we should use `.when(platforms:)` to set `swiftSettings` and
// `dependencies` like on other platforms. However, `Platform.freebsd` is not
// yet available, and therefore we guard the settings behind this boolean.
#if os(FreeBSD)
let isFreeBSD = true
#else
let isFreeBSD = false
#endif

let swiftSettings: [SwiftSetting]
let dependencies: [Target.Dependency]
if development {
if development || isFreeBSD {
swiftSettings = [
.define("CRYPTO_IN_SWIFTPM"),
.define("CRYPTO_IN_SWIFTPM_FORCE_BUILD_API"),
Expand All @@ -44,8 +53,7 @@ if development {
Platform.linux,
Platform.android,
Platform.windows,
Platform.wasi,
Platform.freebsd
Platform.wasi
]
swiftSettings = [
.define("CRYPTO_IN_SWIFTPM"),
Expand Down

0 comments on commit 728cff7

Please sign in to comment.