There was an error while loading. Please reload this page.
2 parents 426d1cc + efd0d1d commit 88f0787Copy full SHA for 88f0787
1 file changed
Package.swift
@@ -1,6 +1,14 @@
1
// swift-tools-version: 6.1
2
import PackageDescription
3
-import Foundation
+import CompilerPluginSupport
4
+import class Foundation.ProcessInfo
5
+
6
+// get environment variables
7
+let environment = ProcessInfo.processInfo.environment
8
+let dynamicLibrary = environment["SWIFT_BUILD_DYNAMIC_LIBRARY"] == "1"
9
10
+// force building as dynamic library
11
+let libraryType: PackageDescription.Product.Library.LibraryType? = dynamicLibrary ? .dynamic : nil
12
13
let package = Package(
14
name: "CoreModel-SQLite",
@@ -13,6 +21,7 @@ let package = Package(
21
products: [
22
.library(
15
23
name: "CoreModelSQLite",
24
+ type: libraryType,
16
25
targets: ["CoreModelSQLite"]
17
26
)
18
27
],
0 commit comments