Files
CMake/Modules/Platform/Apple-Apple-Swift.cmake
Evan Wilde 3fb4092826 Swift: Add CMAKE_LINKER_TYPE support
Extend commit 96a953b1ed (Add options to specify linker tool, 2023-09-27,
v3.29.0-rc1~577^2) with the `CMAKE_Swift_USING_LINKER_*` variables
needed to support `CMAKE_LINKER_TYPE` for Swift.
2024-04-02 10:42:12 -04:00

15 lines
614 B
CMake

set(CMAKE_Swift_SYSROOT_FLAG "-sdk")
# Linker Selections
if("${CMAKE_GENERATOR}" STREQUAL Xcode)
# Xcode always uses clang to link, regardless of what the cmake link language
# is. Pass the clang flags when linking with Xcode.
set(CMAKE_Swift_USING_LINKER_APPLE_CLASSIC "-fuse-ld=ld" "LINKER:-ld_classic")
set(CMAKE_Swift_USING_LINKER_LLD "-fuse-ld=lld")
set(CMAKE_Swift_USING_LINKER_SYSTEM "-fuse-ld=ld")
else()
set(CMAKE_Swift_USING_LINKER_APPLE_CLASSIC "-use-ld=ld" "LINKER:-ld_classic")
set(CMAKE_Swift_USING_LINKER_LLD "-use-ld=lld")
set(CMAKE_Swift_USING_LINKER_SYSTEM "-use-ld=ld")
endif()