Skip to content

Commit 4c67171

Browse files
committed
Add Glibc on Linux
1 parent f7ff5a9 commit 4c67171

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

pkg_swift_llvm.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,18 @@ def export_sdk(tgt, swift_source_tree, swift_build_tree):
137137

138138
def export_stdlibs(exported_dir, swift_build_tree):
139139
ext = 'dylib'
140-
platform = 'macosx'
141-
if get_platform() == "linux":
142-
platform = 'linux'
143-
ext = 'so'
140+
platform = 'linux' if get_platform() == 'linux' else 'macosx'
144141
lib_dir = swift_build_tree / 'lib/swift' / platform
145-
stdlibs = [
146-
lib_dir / f'libswiftCore.{ext}',
147-
lib_dir / f'libswift_RegexParser.{ext}',
148-
]
149-
stdlibs.extend(lib_dir.glob('libswiftCompatibility*.a'))
150-
for stdlib in stdlibs:
151-
print(f'Copying {stdlib}')
152-
shutil.copy(stdlib, exported_dir)
142+
patterns = [f'libswift{dep}.*' for dep in (
143+
"Core",
144+
"_RegexParser",
145+
"Glibc",
146+
"Compatibility*",
147+
)]
148+
for pattern in patterns:
149+
for stdlib in lib_dir.glob(pattern):
150+
print(f'Copying {stdlib}')
151+
shutil.copy(stdlib, exported_dir)
153152

154153

155154
def export_libs(exported_dir, libs, swift_build_tree):

0 commit comments

Comments
 (0)