mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-26 16:39:44 -06:00
The nested Swift module structure is recommended for Swift projects. This structure has an outer directory called `<Swift_MODULE_NAME>.swiftmodule` that contains generated files for the interface. The binary swift modules, textual swift interface, and other supplemental outputs that make up the interface to a Swift library all go in this outer directory with the Swift module triple as the filename followed by the appropriate file extension based on what that file contains. Issue: #19284
13 lines
357 B
CMake
13 lines
357 B
CMake
cmake_policy(SET CMP0157 NEW)
|
|
if(POLICY CMP0195)
|
|
cmake_policy(SET CMP0195 NEW)
|
|
endif()
|
|
enable_language(Swift)
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hello.swift "")
|
|
|
|
add_executable(hello1 ${CMAKE_CURRENT_BINARY_DIR}/hello.swift)
|
|
set_target_properties(hello1 PROPERTIES ENABLE_EXPORTS TRUE)
|
|
|
|
add_executable(hello2 ${CMAKE_CURRENT_BINARY_DIR}/hello.swift)
|