Skip to content

Commit

Permalink
[lit] Repair tests for stdlib-only build
Browse files Browse the repository at this point in the history
`config.host_triple` can be None when no host tools are built

This is based on 21d57e8 in main branch
  • Loading branch information
kateinoigakukun authored and Anka committed Jun 4, 2024
1 parent 9770fc6 commit 4823674
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -573,16 +573,18 @@ else:
)
)
# Parse the host triple.
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
toolchain_lib_dir = None
if config.host_triple:
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
config.host_build_swift = (
"%s -target %s -g %s -I %s -L %s %s" % (
config.swiftc_driver,
config.host_triple,
'' if kIsWindows else '-no-toolchain-stdlib-rpath',
config.swift_build_lib_dir,
config.swift_build_lib_dir,
'' if kIsWindows else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
'' if kIsWindows or toolchain_lib_dir is None else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
)
)

Expand Down

0 comments on commit 4823674

Please sign in to comment.