Files
CMake/Tests/RunCMake/Swift/CMP0157-common.cmake
Evan Wilde c1d787e473 Swift: Add abstraction for compilation mode
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
2023-11-17 08:43:21 -05:00

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")