Skip to content

Commit ecbd523

Browse files
authored
Support: allow building with non-C/C++ language linkers (#65634)
1 parent 730e8f6 commit ecbd523

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/lib/Support/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ endif( MSVC OR MINGW )
7979
# Delay load shell32.dll if possible to speed up process startup.
8080
set (delayload_flags)
8181
if (MSVC)
82-
set (delayload_flags delayimp -delayload:shell32.dll -delayload:ole32.dll)
82+
# When linking with Swift, `swiftc.exe` is used as the linker drive rather
83+
# than invoking `link.exe` directly. In such a case, the flags should be
84+
# marked as `-Xlinker` to pass them directly to the linker. As a temporary
85+
# workaround simply elide the delay loading.
86+
set (delayload_flags $<$<NOT:$<LINK_LANGUAGE:Swift>>:delayimp -delayload:shell32.dll -delayload:ole32.dll>)
8387
endif()
8488

8589
# Link Z3 if the user wants to build it.

0 commit comments

Comments
 (0)