mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
Add a `CMAKE_Swift_COMPILATION_MODE` variable and corresponding `Swift_COMPILATION_MODE` target property to control the compilation mode. Select among `wholemodule`, `singlefile`, and `incremental`. Add policy CMP0157 to remove the default `-wmo` flags in favor of the abstract setting. Issue: #25366
20 lines
635 B
CMake
20 lines
635 B
CMake
enable_language(Swift)
|
|
|
|
add_executable(greetings_default hello.swift)
|
|
|
|
add_executable(greetings_wmo hello.swift)
|
|
set_target_properties(greetings_wmo PROPERTIES
|
|
Swift_COMPILATION_MODE "wholemodule")
|
|
|
|
add_executable(greetings_incremental hello.swift)
|
|
set_target_properties(greetings_incremental PROPERTIES
|
|
Swift_COMPILATION_MODE "incremental")
|
|
|
|
add_executable(greetings_singlefile hello.swift)
|
|
set_target_properties(greetings_singlefile PROPERTIES
|
|
Swift_COMPILATION_MODE "singlefile")
|
|
|
|
add_executable(greetings_who_knows hello.swift)
|
|
set_target_properties(greetings_who_knows PROPERTIES
|
|
Swift_COMPILATION_MODE "not-a-real-mode")
|