@@ -6,22 +6,48 @@ import PackageDescription
66let package = Package (
77 name: " OSCKit " ,
88 platforms: [ . macOS( . v10_15) , . iOS( . v13) , . tvOS( . v13) ] ,
9- products: [
10- . library(
11- name: " OSCKit " ,
12- targets: [ " OSCKit " ]
13- ) ,
14- . library(
15- name: " OSCKitCore " ,
16- targets: [ " OSCKitCore " ]
17- )
18- ] ,
19- dependencies: [
20- . package ( url: " https://github.com/robbiehanson/CocoaAsyncSocket " , from: " 7.0.0 " ) ,
21- . package ( url: " https://github.com/orchetect/SwiftASCII " , from: " 1.1.5 " ) ,
9+ products: products,
10+ dependencies: dependencies,
11+ targets: targets
12+ )
13+
14+ var products : [ Product ] {
15+ var products : [ Product ] = [ ]
16+
17+ #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
18+ products += [
19+ . library( name: " OSCKit " , targets: [ " OSCKit " ] )
20+ ]
21+ #endif
22+
23+ products += [
24+ . library( name: " OSCKitCore " , targets: [ " OSCKitCore " ] )
25+ ]
26+ return products
27+ }
28+
29+ var dependencies : [ Package . Dependency ] {
30+ var dependencies : [ Package . Dependency ] = [ ]
31+
32+ #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
33+ dependencies += [
34+ . package ( url: " https://github.com/robbiehanson/CocoaAsyncSocket " , from: " 7.0.0 " )
35+ ]
36+ #endif
37+
38+ dependencies += [
39+ . package ( url: " https://github.com/orchetect/SwiftASCII " , from: " 1.2.0 " ) ,
2240 . package ( url: " https://github.com/apple/swift-numerics " , from: " 1.0.2 " )
23- ] ,
24- targets: [
41+ ]
42+
43+ return dependencies
44+ }
45+
46+ var targets : [ Target ] {
47+ var targets : [ Target ] = [ ]
48+
49+ #if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(visionOS)
50+ targets += [
2551 . target(
2652 name: " OSCKit " ,
2753 dependencies: [
@@ -34,15 +60,19 @@ let package = Package(
3460 ] ,
3561 swiftSettings: [ . define( " DEBUG " , . when( configuration: . debug) ) ]
3662 ) ,
63+ . testTarget(
64+ name: " OSCKitTests " ,
65+ dependencies: [ " OSCKit " ]
66+ )
67+ ]
68+ #endif
69+
70+ targets += [
3771 . target(
3872 name: " OSCKitCore " ,
3973 dependencies: [ " SwiftASCII " ] ,
4074 swiftSettings: [ . define( " DEBUG " , . when( configuration: . debug) ) ]
4175 ) ,
42- . testTarget(
43- name: " OSCKitTests " ,
44- dependencies: [ " OSCKit " ]
45- ) ,
4676 . testTarget(
4777 name: " OSCKitCoreTests " ,
4878 dependencies: [
@@ -51,4 +81,6 @@ let package = Package(
5181 ]
5282 )
5383 ]
54- )
84+
85+ return targets
86+ }
0 commit comments