Skip to content

Commit 0552fe7

Browse files
committed
build: use forced loading for FoundationNetworking
Since FoundationNetworking symbols are lazily resolved at runtime, no symbol references to it are emitted. On PE/COFF targets (i.e. Windows), this will result in FoundationNetworking not being loaded and linked against. Use the force load symbol to ensure that the reference is preserved.
1 parent f80087a commit 0552fe7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/FoundationNetworking/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ target_compile_definitions(FoundationNetworking PRIVATE
3232
DEPLOYMENT_RUNTIME_SWIFT
3333
NS_BUILDING_FOUNDATION_NETWORKING)
3434
target_compile_options(FoundationNetworking PUBLIC
35+
-autolink-force-load
36+
# SR-12254: workaround for the swift compiler not properly tracking the
37+
# forced load symbol when validating the TBD
38+
-Xfrontend -validate-tbd-against-ir=none
3539
$<$<BOOL:${ENABLE_TESTING}>:-enable-testing>
3640
"SHELL:-Xcc -F${CMAKE_BINARY_DIR}")
3741
target_link_libraries(FoundationNetworking

0 commit comments

Comments
 (0)