Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ add_subdirectory(Sources)
export(EXPORT SwiftSubprocessTargets
FILE "cmake/SwiftSubprocess/SwiftSubprocessTargets.cmake"
NAMESPACE "SwiftSubprocess::")

add_subdirectory(cmake/modules)
4 changes: 4 additions & 0 deletions Sources/Subprocess/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ elseif(APPLE)
Platforms/Subprocess+BSD.swift
Platforms/Subprocess+Darwin.swift
Platforms/Subprocess+Unix.swift)
target_compile_options(Subprocess PRIVATE
"$<$<COMPILE_LANGUAGE:Swift>:-DSUBPROCESS_ASYNCIO_DISPATCH>")
elseif(FREEBSD OR OPENBSD)
target_sources(Subprocess PRIVATE
Platforms/Subprocess+BSD.swift
Platforms/Subprocess+Unix.swift)
target_compile_options(Subprocess PRIVATE
"$<$<COMPILE_LANGUAGE:Swift>:-DSUBPROCESS_ASYNCIO_DISPATCH>")
endif()

target_compile_options(Subprocess PRIVATE
Expand Down
14 changes: 14 additions & 0 deletions cmake/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
##===----------------------------------------------------------------------===##
##
## This source file is part of the Swift.org open source project
##
## Copyright (c) 2025 Apple Inc. and the Swift project authors
## Licensed under Apache License v2.0 with Runtime Library Exception
##
## See https://swift.org/LICENSE.txt for license information
##
##===----------------------------------------------------------------------===##

configure_file(SwiftSubprocessConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/SwiftSubprocessConfig.cmake)

12 changes: 12 additions & 0 deletions cmake/modules/SwiftSubprocessConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
##===----------------------------------------------------------------------===##
##
## This source file is part of the Swift.org open source project
##
## Copyright (c) 2025 Apple Inc. and the Swift project authors
## Licensed under Apache License v2.0 with Runtime Library Exception
##
## See https://swift.org/LICENSE.txt for license information
##
##===----------------------------------------------------------------------===##

include(${CMAKE_CURRENT_BINARY_DIR}/../SwiftSubprocess/SwiftSubprocessTargets.cmake)