Skip to content

Commit 8ef01eb

Browse files
committed
[CMake] Add explicit Glibc dependencies to account for "autolinking" (swiftlang#16401)
76ef276 made the compiler autolink libraries more eagerly than before. This normally wouldn't affect the products we build with CMake, but when an overlay is autolinked the compiler also puts in a dummy symbol to make sure it gets linked. So now we have to link to the overlay directly. (cherry picked from commit 2b31ba3)
1 parent 1c4a3bc commit 8ef01eb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

stdlib/private/StdlibCollectionUnittest/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ add_swift_library(swiftStdlibCollectionUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYP
2020
../../public/core/WriteBackMutableSlice.swift
2121

2222
SWIFT_MODULE_DEPENDS StdlibUnittest
23+
SWIFT_MODULE_DEPENDS_LINUX Glibc
24+
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
25+
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
26+
SWIFT_MODULE_DEPENDS_HAIKU Glibc
2327
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags}
2428
TARGET_SDKS ALL_POSIX_PLATFORMS
2529
INSTALL_IN_COMPONENT stdlib-experimental)

stdlib/private/StdlibUnicodeUnittest/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ add_swift_library(swiftStdlibUnicodeUnittest ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
99
Collation.swift
1010

1111
SWIFT_MODULE_DEPENDS StdlibUnittest
12+
SWIFT_MODULE_DEPENDS_LINUX Glibc
13+
SWIFT_MODULE_DEPENDS_FREEBSD Glibc
14+
SWIFT_MODULE_DEPENDS_CYGWIN Glibc
15+
SWIFT_MODULE_DEPENDS_HAIKU Glibc
1216
SWIFT_COMPILE_FLAGS ${swift_stdlib_unittest_compile_flags}
1317
TARGET_SDKS ALL_POSIX_PLATFORMS
1418
INSTALL_IN_COMPONENT stdlib-experimental)

0 commit comments

Comments
 (0)