@@ -1136,98 +1136,49 @@ details of the setups of other systems or automated environments.""")
1136
1136
platform .system () != "Darwin" ):
1137
1137
args .build_foundation = True
1138
1138
1139
- # Propagate global --skip-build
1140
- if args .skip_build :
1141
- args .skip_build_linux = True
1142
- args .skip_build_freebsd = True
1143
- args .skip_build_cygwin = True
1144
- args .skip_build_osx = True
1145
- args .skip_build_ios = True
1146
- args .skip_build_tvos = True
1147
- args .skip_build_watchos = True
1148
- args .skip_build_android = True
1149
- args .skip_build_benchmarks = True
1150
- args .build_lldb = False
1151
- args .build_llbuild = False
1152
- args .build_swiftpm = False
1153
- args .build_xctest = False
1154
- args .build_foundation = False
1155
- args .build_libdispatch = False
1139
+ # --validation-test implies --test.
1140
+ if args .validation_test :
1141
+ args .test = True
1156
1142
1157
- # --skip-{ios,tvos,watchos} or --skip-build-{ios,tvos,watchos} are
1158
- # merely shorthands for --skip-build-{**os}-{device,simulator}
1159
- if not args .ios or args .skip_build_ios :
1143
+ # --long-test implies --test.
1144
+ if args .long_test :
1145
+ args .test = True
1146
+
1147
+ # --test-optimized implies --test.
1148
+ if args .test_optimized :
1149
+ args .test = True
1150
+
1151
+ # Expand iOS skip_build/test arguments for both device and simulator.
1152
+ if args .skip_build_ios :
1160
1153
args .skip_build_ios_device = True
1161
1154
args .skip_build_ios_simulator = True
1162
1155
1163
- if not args . tvos or args .skip_build_tvos :
1156
+ if args .skip_build_tvos :
1164
1157
args .skip_build_tvos_device = True
1165
1158
args .skip_build_tvos_simulator = True
1166
1159
1167
- if not args . watchos or args .skip_build_watchos :
1160
+ if args .skip_build_watchos :
1168
1161
args .skip_build_watchos_device = True
1169
1162
args .skip_build_watchos_simulator = True
1170
1163
1171
- if not args .android or args .skip_build_android :
1172
- args .skip_build_android = True
1173
-
1174
- # --validation-test implies --test.
1175
- if args .validation_test :
1176
- args .test = True
1177
-
1178
- # --test-optimized implies --test.
1179
- if args .test_optimized :
1180
- args .test = True
1181
-
1182
- # If none of tests specified skip swift stdlib test on all platforms
1183
- if not args .test and not args .validation_test and not args .long_test :
1184
- args .skip_test_linux = True
1185
- args .skip_test_freebsd = True
1186
- args .skip_test_cygwin = True
1187
- args .skip_test_osx = True
1188
- args .skip_test_ios = True
1189
- args .skip_test_tvos = True
1190
- args .skip_test_watchos = True
1191
-
1192
- # --skip-test-ios is merely a shorthand for host and simulator tests.
1193
1164
if args .skip_test_ios :
1194
1165
args .skip_test_ios_host = True
1195
1166
args .skip_test_ios_simulator = True
1196
- # --skip-test-tvos is merely a shorthand for host and simulator tests.
1197
- if args .skip_test_tvos :
1198
- args .skip_test_tvos_host = True
1199
- args .skip_test_tvos_simulator = True
1200
- # --skip-test-watchos is merely a shorthand for host and simulator tests.
1201
- if args .skip_test_watchos :
1202
- args .skip_test_watchos_host = True
1203
- args .skip_test_watchos_simulator = True
1204
1167
1205
- # --skip-build-{ios,tvos,watchos}-{device,simulator} implies
1206
- # --skip-test-{ios,tvos,watchos}-{host,simulator}
1207
- if args .skip_build_ios_device :
1208
- args .skip_test_ios_host = True
1209
- if args .skip_build_ios_simulator :
1210
- args .skip_test_ios_simulator = True
1211
-
1212
- if args .skip_build_tvos_device :
1168
+ if args .skip_test_tvos :
1213
1169
args .skip_test_tvos_host = True
1214
- if args .skip_build_tvos_simulator :
1215
1170
args .skip_test_tvos_simulator = True
1216
1171
1217
- if args .skip_build_watchos_device :
1172
+ if args .skip_test_watchos :
1218
1173
args .skip_test_watchos_host = True
1219
- if args .skip_build_watchos_simulator :
1220
1174
args .skip_test_watchos_simulator = True
1221
1175
1222
- if not args .host_test :
1223
- args .skip_test_ios_host = True
1224
- args .skip_test_tvos_host = True
1225
- args .skip_test_watchos_host = True
1226
-
1227
1176
if args .build_subdir is None :
1228
1177
args .build_subdir = compute_build_subdir (args )
1229
1178
1230
- # Add optional stdlib-deployment-targets
1179
+ # Configure additional selected stdlib-deployment-targets
1180
+ # (we do not need to configure iOS targets, they are part of the default
1181
+ # list).
1231
1182
if args .android :
1232
1183
args .stdlib_deployment_targets .append (
1233
1184
StdlibDeploymentTarget .Android .armv7 )
@@ -1338,10 +1289,61 @@ details of the setups of other systems or automated environments.""")
1338
1289
"--install-symroot" , os .path .abspath (args .install_symroot )
1339
1290
]
1340
1291
1292
+ # Create the build target list.
1293
+ #
1294
+ # Take all of the configured stdlib-deployment-targets
1295
+ # and subtract any we've been told to skip.
1296
+
1297
+ skipped_targets = []
1298
+ if args .skip_build_linux :
1299
+ skipped_targets += StdlibDeploymentTarget .Linux .allArchs
1300
+ if args .skip_build_freebsd :
1301
+ skipped_targets += StdlibDeploymentTarget .FreeBSD .allArchs
1302
+ if args .skip_build_cygwin :
1303
+ skipped_targets += StdlibDeploymentTarget .Cygwin .allArchs
1304
+ if args .skip_build_android :
1305
+ skipped_targets += StdlibDeploymentTarget .Android .allArchs
1306
+ if args .skip_build_osx :
1307
+ skipped_targets += StdlibDeploymentTarget .OSX .allArchs
1308
+
1309
+ # iOS targets are special: they are configured by default, but only built
1310
+ # if the appropriate '--ios'/'--tvos'/... flag is given.
1311
+ if args .skip_build_ios_device or not args .ios :
1312
+ skipped_targets += StdlibDeploymentTarget .iOS .allArchs
1313
+ if args .skip_build_ios_simulator or not args .ios :
1314
+ skipped_targets += StdlibDeploymentTarget .iOSSimulator .allArchs
1315
+ if args .skip_build_tvos_device or not args .tvos :
1316
+ skipped_targets += StdlibDeploymentTarget .AppleTV .allArchs
1317
+ if args .skip_build_tvos_simulator or not args .tvos :
1318
+ skipped_targets += StdlibDeploymentTarget .AppleTVSimulator .allArchs
1319
+ if args .skip_build_watchos_device or not args .watchos :
1320
+ skipped_targets += StdlibDeploymentTarget .AppleWatch .allArchs
1321
+ if args .skip_build_watchos_simulator or not args .watchos :
1322
+ skipped_targets += StdlibDeploymentTarget .AppleWatchSimulator .allArchs
1323
+
1324
+ build_stdlib_deployment_targets = [
1325
+ x for x in args .stdlib_deployment_targets
1326
+ if x not in skipped_targets ]
1327
+
1328
+ if args .skip_build or len (build_stdlib_deployment_targets ) == 0 :
1329
+ build_stdlib_deployment_targets = ['none' ]
1330
+
1331
+ build_script_impl_args += ["--build-stdlib-deployment-targets" ,
1332
+ " " .join (build_stdlib_deployment_targets )]
1333
+
1334
+ # Decide which products to build.
1341
1335
if args .skip_build :
1342
1336
build_script_impl_args += ["--skip-build-cmark" ,
1343
1337
"--skip-build-llvm" ,
1344
1338
"--skip-build-swift" ]
1339
+ args .skip_build_benchmarks = True
1340
+ args .build_lldb = False
1341
+ args .build_llbuild = False
1342
+ args .build_swiftpm = False
1343
+ args .build_xctest = False
1344
+ args .build_foundation = False
1345
+ args .build_libdispatch = False
1346
+
1345
1347
if args .skip_build_benchmarks :
1346
1348
build_script_impl_args += ["--skip-build-benchmarks" ]
1347
1349
if not args .build_foundation :
@@ -1357,29 +1359,46 @@ details of the setups of other systems or automated environments.""")
1357
1359
if not args .build_swiftpm :
1358
1360
build_script_impl_args += ["--skip-build-swiftpm" ]
1359
1361
1360
- if args .skip_build_linux :
1361
- build_script_impl_args += ["--skip-build-linux" ]
1362
- if args .skip_build_freebsd :
1363
- build_script_impl_args += ["--skip-build-freebsd" ]
1364
- if args .skip_build_cygwin :
1365
- build_script_impl_args += ["--skip-build-cygwin" ]
1366
- if args .skip_build_osx :
1367
- build_script_impl_args += ["--skip-build-osx" ]
1368
- if args .skip_build_ios_device :
1369
- build_script_impl_args += ["--skip-build-ios-device" ]
1370
- if args .skip_build_ios_simulator :
1371
- build_script_impl_args += ["--skip-build-ios-simulator" ]
1372
- if args .skip_build_tvos_device :
1373
- build_script_impl_args += ["--skip-build-tvos-device" ]
1374
- if args .skip_build_tvos_simulator :
1375
- build_script_impl_args += ["--skip-build-tvos-simulator" ]
1376
- if args .skip_build_watchos_device :
1377
- build_script_impl_args += ["--skip-build-watchos-device" ]
1378
- if args .skip_build_watchos_simulator :
1379
- build_script_impl_args += ["--skip-build-watchos-simulator" ]
1380
- if args .skip_build_android :
1381
- build_script_impl_args += ["--skip-build-android" ]
1362
+ # Create the test target list.
1363
+ #
1364
+ # Take all of the stdlib-deployment-targets that we're actually building,
1365
+ # and subtract any we've been told to skip.
1382
1366
1367
+ skip_test_tgts = []
1368
+ if args .skip_test_linux :
1369
+ skip_test_tgts += StdlibDeploymentTarget .Linux .allArchs
1370
+ if args .skip_test_freebsd :
1371
+ skip_test_tgts += StdlibDeploymentTarget .FreeBSD .allArchs
1372
+ if args .skip_test_cygwin :
1373
+ skip_test_tgts += StdlibDeploymentTarget .Cygwin .allArchs
1374
+ if args .skip_test_osx :
1375
+ skip_test_tgts += StdlibDeploymentTarget .OSX .allArchs
1376
+ if args .skip_test_ios_simulator :
1377
+ skip_test_tgts += StdlibDeploymentTarget .iOSSimulator .allArchs
1378
+ if args .skip_test_tvos_simulator :
1379
+ skip_test_tgts += StdlibDeploymentTarget .AppleTVSimulator .allArchs
1380
+ if args .skip_test_watchos_simulator :
1381
+ skip_test_tgts += StdlibDeploymentTarget .AppleWatchSimulator .allArchs
1382
+ if args .skip_test_ios_host or not args .host_test :
1383
+ skip_test_tgts += StdlibDeploymentTarget .iOS .allArchs
1384
+ if args .skip_test_tvos_host or not args .host_test :
1385
+ skip_test_tgts += StdlibDeploymentTarget .AppleTV .allArchs
1386
+ if args .skip_test_watchos_host or not args .host_test :
1387
+ skip_test_tgts += StdlibDeploymentTarget .AppleWatch .allArchs
1388
+
1389
+ # The tests do not work on Android yet.
1390
+ skip_test_tgts += StdlibDeploymentTarget .Android .allArchs
1391
+
1392
+ if args .test :
1393
+ test_deployment_targets = [
1394
+ x for x in build_stdlib_deployment_targets
1395
+ if x not in skip_test_tgts ]
1396
+
1397
+ if len (test_deployment_targets ) > 0 :
1398
+ build_script_impl_args += ["--test-stdlib-deployment-targets" ,
1399
+ " " .join (test_deployment_targets )]
1400
+
1401
+ # Decide which products to test
1383
1402
if not args .test and not args .long_test :
1384
1403
build_script_impl_args += ["--skip-test-swift" ]
1385
1404
if not args .test :
@@ -1390,26 +1409,7 @@ details of the setups of other systems or automated environments.""")
1390
1409
"--skip-test-xctest" ,
1391
1410
"--skip-test-foundation" ,
1392
1411
"--skip-test-libdispatch" ]
1393
- if args .skip_test_linux :
1394
- build_script_impl_args += ["--skip-test-linux" ]
1395
- if args .skip_test_freebsd :
1396
- build_script_impl_args += ["--skip-test-freebsd" ]
1397
- if args .skip_test_cygwin :
1398
- build_script_impl_args += ["--skip-test-cygwin" ]
1399
- if args .skip_test_osx :
1400
- build_script_impl_args += ["--skip-test-osx" ]
1401
- if args .skip_test_ios_host :
1402
- build_script_impl_args += ["--skip-test-ios-host" ]
1403
- if args .skip_test_ios_simulator :
1404
- build_script_impl_args += ["--skip-test-ios-simulator" ]
1405
- if args .skip_test_tvos_host :
1406
- build_script_impl_args += ["--skip-test-tvos-host" ]
1407
- if args .skip_test_tvos_simulator :
1408
- build_script_impl_args += ["--skip-test-tvos-simulator" ]
1409
- if args .skip_test_watchos_host :
1410
- build_script_impl_args += ["--skip-test-watchos-host" ]
1411
- if args .skip_test_watchos_simulator :
1412
- build_script_impl_args += ["--skip-test-watchos-simulator" ]
1412
+
1413
1413
if args .build_runtime_with_host_compiler :
1414
1414
build_script_impl_args += ["--build-runtime-with-host-compiler" ]
1415
1415
if args .validation_test :
@@ -1421,6 +1421,7 @@ details of the setups of other systems or automated environments.""")
1421
1421
if not args .test_optimized :
1422
1422
build_script_impl_args += ["--skip-test-optimized" ]
1423
1423
1424
+ # Other arguments
1424
1425
if args .android :
1425
1426
build_script_impl_args += [
1426
1427
"--android-ndk" , args .android_ndk ,
0 commit comments