mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
The `-static` is important for the emission of the module as it is serialized into the swiftmodule which then is used by the Swift frontend to decide how to link to the symbol (via the GOT or not, or the IAT on Windows). This repairs building static libraries with Swift on Windows.
9 lines
169 B
CMake
9 lines
169 B
CMake
if(POLICY CMP0157)
|
|
cmake_policy(SET CMP0157 NEW)
|
|
endif()
|
|
|
|
enable_language(Swift)
|
|
|
|
add_library(StaticLibrary STATIC L.swift)
|
|
add_library(DynamicLibrary SHARED L.swift)
|