@@ -15,10 +15,14 @@ let package = Package(
1515 name: " WasmParser " ,
1616 targets: [ " WasmParser " ]
1717 ) ,
18+ . library(
19+ name: " WIT " , targets: [ " WIT " ]
20+ ) ,
1821 . executable(
1922 name: " wasmkit-cli " ,
2023 targets: [ " CLI " ]
2124 ) ,
25+ . library( name: " _CabiShims " , targets: [ " _CabiShims " ] ) ,
2226 ] ,
2327 targets: [
2428 . executableTarget(
@@ -59,6 +63,24 @@ let package = Package(
5963 . product( name: " SystemPackage " , package : " swift-system " ) ,
6064 ]
6165 ) ,
66+ . target( name: " WIT " ) ,
67+ . testTarget( name: " WITTests " , dependencies: [ " WIT " ] ) ,
68+ . target( name: " WITOverlayGenerator " , dependencies: [ " WIT " ] ) ,
69+ . target( name: " _CabiShims " ) ,
70+ . target( name: " WITExtractor " ) ,
71+ . testTarget(
72+ name: " WITExtractorTests " ,
73+ dependencies: [ " WITExtractor " , " WIT " ]
74+ ) ,
75+ . executableTarget(
76+ name: " WITTool " ,
77+ dependencies: [
78+ " WIT " ,
79+ " WITOverlayGenerator " ,
80+ " WITExtractor " ,
81+ . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
82+ ]
83+ ) ,
6284 . testTarget(
6385 name: " WasmKitTests " ,
6486 dependencies: [ " WasmKit " ]
@@ -119,10 +141,6 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
119141 name: " WASITests " ,
120142 dependencies: [ " WASI " ]
121143 ) ,
122- . testTarget(
123- name: " WASITests " ,
124- dependencies: [ " WASI " ]
125- ) ,
126144 ] )
127145 let targetDependenciesToAdd = [
128146 " CLI " : [ " WasmKitWASI " ] ,
@@ -136,19 +154,13 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
136154 }
137155 }
138156
139- // Add WIT-related products and targets
157+ // Add build tool plugins only for non-Windows platforms
140158 package . products. append ( contentsOf: [
141- . library( name: " WIT " , targets: [ " WIT " ] ) ,
142- . library( name: " _CabiShims " , targets: [ " _CabiShims " ] ) ,
143159 . plugin( name: " WITOverlayPlugin " , targets: [ " WITOverlayPlugin " ] ) ,
144160 . plugin( name: " WITExtractorPlugin " , targets: [ " WITExtractorPlugin " ] ) ,
145161 ] )
146162
147163 package . targets. append ( contentsOf: [
148- . target( name: " WIT " ) ,
149- . testTarget( name: " WITTests " , dependencies: [ " WIT " ] ) ,
150- . target( name: " WITOverlayGenerator " , dependencies: [ " WIT " ] ) ,
151- . target( name: " _CabiShims " ) ,
152164 . plugin( name: " WITOverlayPlugin " , capability: . buildTool( ) , dependencies: [ " WITTool " ] ) ,
153165 . plugin( name: " GenerateOverlayForTesting " , capability: . buildTool( ) , dependencies: [ " WITTool " ] ) ,
154166 . testTarget(
@@ -157,11 +169,6 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
157169 exclude: [ " Fixtures " , " Compiled " , " Generated " ] ,
158170 plugins: [ . plugin( name: " GenerateOverlayForTesting " ) ]
159171 ) ,
160- . target( name: " WITExtractor " ) ,
161- . testTarget(
162- name: " WITExtractorTests " ,
163- dependencies: [ " WITExtractor " , " WIT " ]
164- ) ,
165172 . plugin(
166173 name: " WITExtractorPlugin " ,
167174 capability: . command(
@@ -174,14 +181,5 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
174181 name: " WITExtractorPluginTests " ,
175182 exclude: [ " Fixtures " ]
176183 ) ,
177- . executableTarget(
178- name: " WITTool " ,
179- dependencies: [
180- " WIT " ,
181- " WITOverlayGenerator " ,
182- " WITExtractor " ,
183- . product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
184- ]
185- ) ,
186184 ] )
187185#endif
0 commit comments