@@ -148,6 +148,9 @@ def _apply_default_arguments(args):
148
148
if not args .android or not args .build_android :
149
149
args .build_android = False
150
150
151
+ if not args .wasi or not args .build_wasi :
152
+ args .build_wasi = False
153
+
151
154
# --test-paths implies --test and/or --validation-test
152
155
# depending on what directories/files have been specified.
153
156
if args .test_paths :
@@ -184,6 +187,7 @@ def _apply_default_arguments(args):
184
187
args .test_tvos = False
185
188
args .test_watchos = False
186
189
args .test_android = False
190
+ args .test_wasi = False
187
191
args .test_swiftpm = False
188
192
args .test_swiftsyntax = False
189
193
args .test_indexstoredb = False
@@ -230,11 +234,19 @@ def _apply_default_arguments(args):
230
234
if not args .test_android :
231
235
args .test_android_host = False
232
236
237
+ if not args .build_wasi :
238
+ args .test_wasi = False
239
+ args .test_wasi_host = False
240
+
241
+ if not args .test_wasi :
242
+ args .test_wasi_host = False
243
+
233
244
if not args .host_test :
234
245
args .test_ios_host = False
235
246
args .test_tvos_host = False
236
247
args .test_watchos_host = False
237
248
args .test_android_host = False
249
+ args .test_wasi_host = False
238
250
239
251
240
252
def create_argument_parser ():
@@ -323,6 +335,9 @@ def create_argument_parser():
323
335
option ('--android' , toggle_true ,
324
336
help = 'also build for Android' )
325
337
338
+ option ('--wasi' , toggle_true ,
339
+ help = 'also build for WebAssembly/WASI' )
340
+
326
341
option ('--swift-analyze-code-coverage' , store ,
327
342
choices = ['false' , 'not-merged' , 'merged' ],
328
343
# so CMake can see the inert mode as a false value
@@ -919,6 +934,9 @@ def create_argument_parser():
919
934
option ('--skip-build-android' , toggle_false ('build_android' ),
920
935
help = 'skip building Swift stdlibs for Android' )
921
936
937
+ option ('--skip-build-wasi' , toggle_false ('build_wasi' ),
938
+ help = 'skip building Swift stdlibs for WebAssembly/WASI' )
939
+
922
940
option ('--skip-build-benchmarks' , toggle_false ('build_benchmarks' ),
923
941
help = 'skip building Swift Benchmark Suite' )
924
942
@@ -975,6 +993,14 @@ def create_argument_parser():
975
993
help = 'skip testing Android device targets on the host machine (the '
976
994
'phone itself)' )
977
995
996
+ option ('--skip-test-wasi' ,
997
+ toggle_false ('test_wasi' ),
998
+ help = 'skip testing all WebAssembly/WASI targets.' )
999
+ option ('--skip-test-wasi-host' ,
1000
+ toggle_false ('test_wasi_host' ),
1001
+ help = 'skip testing WebAssembly/WASI device targets on the host machine (the '
1002
+ 'WebAssembly/WASI runtime)' )
1003
+
978
1004
option ('--skip-test-swiftpm' , toggle_false ('test_swiftpm' ),
979
1005
help = 'skip testing swiftpm' )
980
1006
option ('--skip-test-swiftsyntax' , toggle_false ('test_swiftsyntax' ),
@@ -1043,6 +1069,24 @@ def create_argument_parser():
1043
1069
'Currently only armv7 and aarch64 are supported. '
1044
1070
'%(default)s is the default.' )
1045
1071
1072
+ # -------------------------------------------------------------------------
1073
+ in_group ('Build settings for WebAssembly/WASI' )
1074
+
1075
+ option ('--wasi-sysroot' , store_path ,
1076
+ help = 'An absolute path to WASI sysroot that will be used as a libc '
1077
+ 'implementation for WebAssembly builds' )
1078
+
1079
+ option ('--wasi-icu-uc' , store_path ,
1080
+ help = 'Path to libicuuc.a' )
1081
+ option ('--wasi-icu-uc-include' , store_path ,
1082
+ help = 'Path to a directory containing headers for libicuuc' )
1083
+ option ('--wasi-icu-i18n' , store_path ,
1084
+ help = 'Path to libicui18n.a' )
1085
+ option ('--wasi-icu-i18n-include' , store_path ,
1086
+ help = 'Path to a directory containing headers libicui18n' )
1087
+ option ('--wasi-icu-data' , store_path ,
1088
+ help = 'Path to libicudata.a' )
1089
+
1046
1090
# -------------------------------------------------------------------------
1047
1091
in_group ('Experimental language features' )
1048
1092
0 commit comments