// swift-tools-version:5.0
import PackageDescription

#if os(Linux)
let libraryType: PackageDescription.Product.Library.LibraryType = .dynamic
#else
let libraryType: PackageDescription.Product.Library.LibraryType = .static
#endif

_ = Package(name: "GATT",
            products: [
                .library(
                    name: "GATT",
                    type: libraryType,
                    targets: ["GATT"]
                ),
                .library(
                    name: "DarwinGATT",
                    type: libraryType,
                    targets: ["DarwinGATT"]
                )
            ],
            dependencies: [
                .package(
                    url: "https://github.com/PureSwift/Bluetooth.git",
                    .branch("master")
                )
            ],
            targets: [
                .target(name: "GATT", dependencies: ["Bluetooth"]),
                .target(name: "DarwinGATT", dependencies: ["GATT"]),
                .testTarget(name: "GATTTests", dependencies: ["GATT"])
            ],
            swiftLanguageVersions: [.v5])

// swift-tools-version:5.0
import PackageDescription

_ = Package(name: "GATT",
            products: [
                .library(
                    name: "GATT",
                    type: .dynamic,
                    targets: ["GATT"]
                ),
                .library(
                    name: "DarwinGATT",
                    type: .dynamic,
                    targets: ["DarwinGATT"]
                )
            ],
            dependencies: [
                .package(
                    url: "https://github.com/PureSwift/Bluetooth.git",
                    .branch("master")
                )
            ],
            targets: [
                .target(name: "GATT", dependencies: ["Bluetooth"]),
                .target(name: "DarwinGATT", dependencies: ["GATT"]),
                .testTarget(name: "GATTTests", dependencies: ["GATT"])
            ],
            swiftLanguageVersions: [.v5])

--- 
+++ 
@@ -1,16 +1,22 @@
 // swift-tools-version:5.0
 import PackageDescription
+
+#if os(Linux)
+let libraryType: PackageDescription.Product.Library.LibraryType = .dynamic
+#else
+let libraryType: PackageDescription.Product.Library.LibraryType = .static
+#endif
 
 _ = Package(name: "GATT",
             products: [
                 .library(
                     name: "GATT",
-                    type: .dynamic,
+                    type: libraryType,
                     targets: ["GATT"]
                 ),
                 .library(
                     name: "DarwinGATT",
-                    type: .dynamic,
+                    type: libraryType,
                     targets: ["DarwinGATT"]
                 )
             ],
Build dynamic framework on Linux
