@@ -962,6 +962,11 @@ if run_vendor == 'apple':
962
962
config .target_sil_opt = (
963
963
"%s %s %s %s" %
964
964
(xcrun_prefix , config .sil_opt , target_options , config .sil_test_options ))
965
+ subst_target_sil_opt_mock_sdk = (
966
+ "%s %s" %
967
+ (config .sil_opt , target_options_for_mock_sdk ))
968
+ subst_target_sil_opt_mock_sdk_after = \
969
+ target_options_for_mock_sdk_after
965
970
config .target_swift_symbolgraph_extract = (
966
971
"%s %s %s" %
967
972
(xcrun_prefix , config .swift_symbolgraph_extract , target_options ))
@@ -1042,6 +1047,8 @@ elif run_os in ['windows-msvc']:
1042
1047
('%r -target %s %s %s %s' % (config .sil_opt , config .variant_triple , \
1043
1048
resource_dir_opt , mcp_opt , \
1044
1049
config .sil_test_options ))
1050
+ subst_target_sil_opt_mock_sdk = config .target_sil_opt
1051
+ subst_target_sil_opt_mock_sdk_after = ''
1045
1052
config .target_swift_symbolgraph_extract = \
1046
1053
('%r -target %s %s' % (config .swift_symbolgraph_extract , \
1047
1054
config .variant_triple , \
@@ -1151,6 +1158,8 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-
1151
1158
config .target_sil_opt = (
1152
1159
'%s -target %s %s %s %s' %
1153
1160
(config .sil_opt , config .variant_triple , resource_dir_opt , mcp_opt , config .sil_test_options ))
1161
+ subst_target_sil_opt_mock_sdk = config .target_sil_opt
1162
+ subst_target_sil_opt_mock_sdk_after = ""
1154
1163
config .target_swift_symbolgraph_extract = (
1155
1164
'%s -target %s %s' %
1156
1165
(config .swift_symbolgraph_extract , config .variant_triple , mcp_opt ))
@@ -1272,6 +1281,8 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android':
1272
1281
'-target' , config .variant_triple ,
1273
1282
android_include_paths_opt ,
1274
1283
resource_dir_opt , mcp_opt , config .sil_test_options ])
1284
+ subst_target_sil_opt_mock_sdk = config .target_sil_opt
1285
+ subst_target_sil_opt_mock_sdk_after = ""
1275
1286
config .target_swift_symbolgraph_extract = ' ' .join ([
1276
1287
config .swift_symbolgraph_extract ,
1277
1288
'-target' , config .variant_triple ,
@@ -1794,7 +1805,13 @@ config.substitutions.append(('%scale-test',
1794
1805
config .substitutions .append (('%empty-directory\(([^)]+)\)' ,
1795
1806
SubstituteCaptures (r'rm -rf "\1" && mkdir -p "\1"' )))
1796
1807
1808
+ config .substitutions .append (('%target-sil-opt\(mock-sdk:([^)]+)\)' ,
1809
+ SubstituteCaptures (r'%s \1 %s' % (subst_target_sil_opt_mock_sdk ,
1810
+ subst_target_sil_opt_mock_sdk_after ))))
1811
+ # NOTE: This needs to be appended after the mock-sdk expansion to ensure that we
1812
+ # first expand the mock-sdk when lit is processing.
1797
1813
config .substitutions .append (('%target-sil-opt' , config .target_sil_opt ))
1814
+
1798
1815
config .substitutions .append (('%target-sil-func-extractor' , config .target_sil_func_extractor ))
1799
1816
config .substitutions .append (('%target-sil-llvm-gen' , config .target_sil_llvm_gen ))
1800
1817
config .substitutions .append (('%target-sil-nm' , config .target_sil_nm ))
0 commit comments