Skip to content

Commit bd41f66

Browse files
committed
runtime: fix build of the runtime tests for Windows
Ensure that the local definition of the stdlib functions are marked for export. We would previously mark the runtime functions as dllimport on Windows.
1 parent 79d29dc commit bd41f66

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

unittests/runtime/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
4747
$<TARGET_OBJECTS:swiftRuntime${SWIFT_PRIMARY_VARIANT_SUFFIX}>
4848
)
4949

50+
# The local stdlib implementation provides definitions of the swiftCore
51+
# interfaes to avoid pulling in swiftCore itself. Build the SwiftRuntimeTests
52+
# with swiftCore_EXPORTS to permit exporting the stdlib interfaces.
53+
target_compile_definitions(SwiftRuntimeTests
54+
PRIVATE
55+
swiftCore_EXPORTS)
56+
5057
# FIXME: cross-compile for all variants.
5158
target_link_libraries(SwiftRuntimeTests
5259
swiftCore${SWIFT_PRIMARY_VARIANT_SUFFIX}

0 commit comments

Comments
 (0)