Skip to content

Commit 0007eaf

Browse files
authored
Merge pull request swiftlang#22255 from compnerd/where-are-thou-implib
2 parents 5baae54 + 0a1abdc commit 0007eaf

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

stdlib/public/SwiftOnoneSupport/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,19 @@ add_swift_target_library(swiftSwiftOnoneSupport ${SWIFT_STDLIB_LIBRARY_BUILD_TYP
99
SWIFT_COMPILE_FLAGS "-parse-stdlib" "-Xllvm" "-sil-inline-generics=false" "-Xfrontend" "-validate-tbd-against-ir=none" "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
1010
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
1111
INSTALL_IN_COMPONENT stdlib)
12+
if(CMAKE_BUILD_TYPE STREQUAL Debug AND WINDOWS IN_LIST SWIFT_SDKS)
13+
# When building in Debug mode, the standard library provides the symbols that
14+
# we need and as such SwiftOnoneSupport does not need to provide any exported
15+
# interfaces. This results in the import library beinging elided. However,
16+
# we explicitly link against the SwiftOnoneSupport library when building
17+
# programs in Debug mode, and need the import library to be generated even if
18+
# nothing is exported. Because we will still generate the DLL, create an
19+
# empty import library.
20+
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/SwiftOnoneSupport.def
21+
"LIBRARY SwiftOnoneSupport\n"
22+
"EXPORTS")
23+
foreach(architecture ${SWIFT_SDK_WINDOWS_ARCHITECTURES})
24+
target_sources(swiftSwiftOnoneSupport-windows-${architecture} PRIVATE
25+
${CMAKE_CURRENT_BINARY_DIR}/SwiftOnoneSupport.def)
26+
endforeach()
27+
endif()

0 commit comments

Comments
 (0)