Files
cmake/Modules/Platform/Windows-Apple-Swift.cmake
Saleem Abdulrasool 404f6bac3c Swift: support PDB emission with Swift
Swift supports CodeView/PDB for Windows (with active development ongoing
to make it the default). It is currently usable but does not have the
same fidelity as DWARF, but can be sufficient for many use cases. The
user is able to control this via flags. Wire up the necessary support to
allow `TARGET_PDB_FILE` to be used with Swift/Swift-only targets.
2026-05-16 09:05:46 -04:00

13 lines
509 B
CMake

set(CMAKE_Swift_IMPLIB_LINKER_FLAGS "-Xlinker -implib:<TARGET_IMPLIB>")
set(CMAKE_Swift_PDB_LINKER_FLAGS "-Xlinker -pdb:<TARGET_PDB>")
set(CMAKE_Swift_LINKER_SUPPORTS_PDB ON)
set(CMAKE_Swift_FLAGS_DEBUG_LINKER_FLAGS "-Xlinker -debug")
set(CMAKE_Swift_FLAGS_RELWITHDEBINFO_LINKER_FLAGS "-Xlinker -debug")
# Linker Selection
set(CMAKE_Swift_USING_LINKER_SYSTEM "-use-ld=link")
set(CMAKE_Swift_USING_LINKER_LLD "-use-ld=lld")
set(CMAKE_Swift_USING_LINKER_MSVC "-use-ld=link")
set(CMAKE_Swift_LINK_MODE DRIVER)