@@ -147,6 +147,9 @@ def _apply_default_arguments(args):
147147 if not args .android or not args .build_android :
148148 args .build_android = False
149149
150+ if not args .wasi or not args .build_wasi :
151+ args .build_wasi = False
152+
150153 # --test-paths implies --test and/or --validation-test
151154 # depending on what directories/files have been specified.
152155 if args .test_paths :
@@ -183,6 +186,7 @@ def _apply_default_arguments(args):
183186 args .test_tvos = False
184187 args .test_watchos = False
185188 args .test_android = False
189+ args .test_wasi = False
186190 args .test_swiftpm = False
187191 args .test_swiftsyntax = False
188192 args .test_indexstoredb = False
@@ -233,6 +237,12 @@ def _apply_default_arguments(args):
233237 if not args .test_android :
234238 args .test_android_host = False
235239
240+ if not args .build_wasi :
241+ args .test_wasi = False
242+
243+ if not args .test_wasi :
244+ args .test_wasi = False
245+
236246 if not args .host_test :
237247 args .test_ios_host = False
238248 args .test_tvos_host = False
@@ -326,6 +336,9 @@ def create_argument_parser():
326336 option ('--android' , toggle_true ,
327337 help = 'also build for Android' )
328338
339+ option ('--wasi' , toggle_true ,
340+ help = 'also build for WebAssembly/WASI' )
341+
329342 option ('--swift-analyze-code-coverage' , store ,
330343 choices = ['false' , 'not-merged' , 'merged' ],
331344 # so CMake can see the inert mode as a false value
@@ -932,6 +945,9 @@ def create_argument_parser():
932945 option ('--skip-build-android' , toggle_false ('build_android' ),
933946 help = 'skip building Swift stdlibs for Android' )
934947
948+ option ('--skip-build-wasi' , toggle_false ('build_wasi' ),
949+ help = 'skip building Swift stdlibs for WebAssembly/WASI' )
950+
935951 option ('--skip-build-benchmarks' , toggle_false ('build_benchmarks' ),
936952 help = 'skip building Swift Benchmark Suite' )
937953
@@ -988,6 +1004,10 @@ def create_argument_parser():
9881004 help = 'skip testing Android device targets on the host machine (the '
9891005 'phone itself)' )
9901006
1007+ option ('--skip-test-wasi' ,
1008+ toggle_false ('test_wasi' ),
1009+ help = 'skip testing all WebAssembly/WASI targets.' )
1010+
9911011 option ('--skip-test-swiftpm' , toggle_false ('test_swiftpm' ),
9921012 help = 'skip testing swiftpm' )
9931013 option ('--skip-test-swiftsyntax' , toggle_false ('test_swiftsyntax' ),
@@ -1011,7 +1031,7 @@ def create_argument_parser():
10111031 in_group ('Build settings specific for LLVM' )
10121032
10131033 option ('--llvm-targets-to-build' , store ,
1014- default = 'X86;ARM;AArch64;PowerPC;SystemZ;Mips' ,
1034+ default = 'X86;ARM;AArch64;PowerPC;SystemZ;Mips;WebAssembly ' ,
10151035 help = 'LLVM target generators to build' )
10161036
10171037 # -------------------------------------------------------------------------
0 commit comments