@@ -1001,6 +1001,11 @@ if run_vendor == 'apple':
1001
1001
config .target_sil_opt = (
1002
1002
"%s %s %s %s" %
1003
1003
(xcrun_prefix , config .sil_opt , target_options , config .sil_test_options ))
1004
+ subst_target_sil_opt_mock_sdk = (
1005
+ "%s %s" %
1006
+ (config .sil_opt , target_options_for_mock_sdk ))
1007
+ subst_target_sil_opt_mock_sdk_after = \
1008
+ target_options_for_mock_sdk_after
1004
1009
config .target_swift_symbolgraph_extract = (
1005
1010
"%s %s %s" %
1006
1011
(xcrun_prefix , config .swift_symbolgraph_extract , target_options ))
@@ -1080,6 +1085,8 @@ elif run_os in ['windows-msvc']:
1080
1085
('%r -target %s %s %s %s' % (config .sil_opt , config .variant_triple , \
1081
1086
resource_dir_opt , mcp_opt , \
1082
1087
config .sil_test_options ))
1088
+ subst_target_sil_opt_mock_sdk = config .target_sil_opt
1089
+ subst_target_sil_opt_mock_sdk_after = ''
1083
1090
config .target_swift_symbolgraph_extract = \
1084
1091
('%r -target %s %s' % (config .swift_symbolgraph_extract , \
1085
1092
config .variant_triple , \
@@ -1183,6 +1190,8 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-
1183
1190
config .target_sil_opt = (
1184
1191
'%s -target %s %s %s %s' %
1185
1192
(config .sil_opt , config .variant_triple , resource_dir_opt , mcp_opt , config .sil_test_options ))
1193
+ subst_target_sil_opt_mock_sdk = config .target_sil_opt
1194
+ subst_target_sil_opt_mock_sdk_after = ""
1186
1195
config .target_swift_symbolgraph_extract = (
1187
1196
'%s -target %s %s' %
1188
1197
(config .swift_symbolgraph_extract , config .variant_triple , mcp_opt ))
@@ -1303,6 +1312,8 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
1303
1312
'-target' , config .variant_triple ,
1304
1313
android_include_paths_opt ,
1305
1314
resource_dir_opt , mcp_opt , config .sil_test_options ])
1315
+ subst_target_sil_opt_mock_sdk = config .target_sil_opt
1316
+ subst_target_sil_opt_mock_sdk_after = ""
1306
1317
config .target_swift_symbolgraph_extract = ' ' .join ([
1307
1318
config .swift_symbolgraph_extract ,
1308
1319
'-target' , config .variant_triple ,
@@ -1754,7 +1765,13 @@ config.substitutions.append(('%scale-test',
1754
1765
config .substitutions .append (('%empty-directory\(([^)]+)\)' ,
1755
1766
SubstituteCaptures (r'rm -rf "\1" && mkdir -p "\1"' )))
1756
1767
1768
+ config .substitutions .append (('%target-sil-opt\(mock-sdk:([^)]+)\)' ,
1769
+ SubstituteCaptures (r'%s \1 %s' % (subst_target_sil_opt_mock_sdk ,
1770
+ subst_target_sil_opt_mock_sdk_after ))))
1771
+ # NOTE: This needs to be appended after the mock-sdk expansion to ensure that we
1772
+ # first expand the mock-sdk when lit is processing.
1757
1773
config .substitutions .append (('%target-sil-opt' , config .target_sil_opt ))
1774
+
1758
1775
config .substitutions .append (('%target-sil-func-extractor' , config .target_sil_func_extractor ))
1759
1776
config .substitutions .append (('%target-sil-llvm-gen' , config .target_sil_llvm_gen ))
1760
1777
config .substitutions .append (('%target-sil-nm' , config .target_sil_nm ))
0 commit comments