Skip to content

Commit 1791b11

Browse files
[Darwin] Fix lit substitution for mtargetos flag on darwin devices (#96953)
Changes substitution logic to appropriately parse either format for min deployment flag: -mtargetos={platform}{major}.{min){?-simulator} or -m{platform}-{sim}-version-min={major}.{min} as the apple_platform_min_deployment_target_flag. rdar://130022065
1 parent a9c43b9 commit 1791b11

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

compiler-rt/test/lit.common.cfg.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -586,21 +586,18 @@ def get_macos_aligned_version(macos_vers):
586586
for vers in min_macos_deployment_target_substitutions:
587587
flag = config.apple_platform_min_deployment_target_flag
588588
major, minor = get_macos_aligned_version(vers)
589-
if "mtargetos" in flag:
589+
apple_device = ""
590+
sim = ""
591+
if "target" in flag:
592+
apple_device = config.apple_platform.split("sim")[0]
590593
sim = "-simulator" if "sim" in config.apple_platform else ""
591-
config.substitutions.append(
592-
(
593-
"%%min_macos_deployment_target=%s.%s" % vers,
594-
"{}{}.{}{}".format(flag, major, minor, sim),
595-
)
596-
)
597-
else:
598-
config.substitutions.append(
599-
(
600-
"%%min_macos_deployment_target=%s.%s" % vers,
601-
"{}={}.{}".format(flag, major, minor),
602-
)
594+
595+
config.substitutions.append(
596+
(
597+
"%%min_macos_deployment_target=%s.%s" % vers,
598+
"{}={}{}.{}{}".format(flag, apple_device, major, minor, sim),
603599
)
600+
)
604601
else:
605602
for vers in min_macos_deployment_target_substitutions:
606603
config.substitutions.append(("%%min_macos_deployment_target=%s.%s" % vers, ""))

0 commit comments

Comments
 (0)