Skip to content

Commit ed34973

Browse files
committed
Special-case catalyst when computing a path for stdlib_dir in lit config
target_sdk_name is `macosx` when targeting `maccatalyst`, but the stdlib swift modules are placed under `swift/maccatalyst` instead of `swift/macosx`. Using `run_os` is not correct in the general sense though, hence the requirement for a special case instead of just replacing `target_sdk_name` with it. For example, it would be invalid to use run_os instead of target_sdk_name on Windows, because the sdk_name is going to be windows while the run_os variable may be windows-msvc.
1 parent c3c032b commit ed34973

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/lit.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,10 @@ config.substitutions.append(('%target-sdk-name', config.target_sdk_name))
14501450
# Add 'stdlib_dir' as the path to the stdlib resource directory
14511451
stdlib_dir = os.path.join(config.swift_lib_dir, "swift")
14521452
if platform.system() == 'Darwin':
1453-
stdlib_dir = os.path.join(stdlib_dir, config.target_sdk_name)
1453+
if run_os == 'maccatalyst':
1454+
stdlib_dir = os.path.join(stdlib_dir, run_os)
1455+
else:
1456+
stdlib_dir = os.path.join(stdlib_dir, config.target_sdk_name)
14541457
else:
14551458
stdlib_dir = os.path.join(stdlib_dir, config.target_sdk_name, target_arch)
14561459
config.substitutions.append(('%stdlib_dir', stdlib_dir))

0 commit comments

Comments
 (0)