mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
Motivation: We've been asked to enable building swift-nio with CMake, and the request isn't totally outrageous, so we're gonna do it. Modifications: - Add CI for our cmake rules - Provide missing module.modulemap files. - Add CMakeLists skeletons as needed. Result: Builds with CMake work now.
29 lines
1009 B
CMake
29 lines
1009 B
CMake
##===----------------------------------------------------------------------===##
|
|
##
|
|
## This source file is part of the SwiftNIO open source project
|
|
##
|
|
## Copyright (c) 2026 Apple Inc. and the SwiftNIO project authors
|
|
## Licensed under Apache License v2.0
|
|
##
|
|
## See LICENSE.txt for license information
|
|
## See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
##
|
|
## SPDX-License-Identifier: Apache-2.0
|
|
##
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
add_library(NIOFileSystem
|
|
"Exports.swift"
|
|
)
|
|
|
|
target_link_libraries(NIOFileSystem PUBLIC
|
|
_NIOFileSystem)
|
|
|
|
target_compile_options(NIOFileSystem PRIVATE ${SWIFT_NIO_COMPILE_OPTIONS})
|
|
target_compile_definitions(NIOFileSystem PRIVATE $<$<NOT:$<CONFIG:Release,RelWithDebInfo,MinSizeRel>>:DEBUG>)
|
|
set_target_properties(NIOFileSystem PROPERTIES
|
|
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
|
|
|
|
swift_nio_install_target(NIOFileSystem)
|
|
set_property(GLOBAL APPEND PROPERTY SWIFT_NIO_EXPORTS NIOFileSystem)
|