Files
swift-nio/Sources/_NIOFileSystemFoundationCompat/CMakeLists.txt
T
Cory Benfield f256ae5df9 Enable building swift-nio with CMake (#3797)
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.
2026-11-23 17:56:53 +00:00

33 lines
1.3 KiB
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(_NIOFileSystemFoundationCompat
"Data+FileSystem.swift"
"Date+FileInfo.swift"
)
target_link_libraries(_NIOFileSystemFoundationCompat PUBLIC
_NIOFileSystem
NIOCore
NIOFoundationEssentialsCompat
$<$<NOT:$<PLATFORM_ID:Darwin>>:$<TARGET_NAME_IF_EXISTS:FoundationEssentials>>)
target_compile_options(_NIOFileSystemFoundationCompat PRIVATE ${SWIFT_NIO_COMPILE_OPTIONS})
target_compile_definitions(_NIOFileSystemFoundationCompat PRIVATE $<$<NOT:$<CONFIG:Release,RelWithDebInfo,MinSizeRel>>:DEBUG>)
set_target_properties(_NIOFileSystemFoundationCompat PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
swift_nio_install_target(_NIOFileSystemFoundationCompat)
set_property(GLOBAL APPEND PROPERTY SWIFT_NIO_EXPORTS _NIOFileSystemFoundationCompat)