File tree Expand file tree Collapse file tree 6 files changed +72
-0
lines changed Expand file tree Collapse file tree 6 files changed +72
-0
lines changed Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 3.29 )
2
+ project (Subprocess LANGUAGES C Swift )
3
+ list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/modules" )
4
+
5
+ add_compile_options ("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name ${PROJECT_NAME} >" )
6
+
7
+ include (InstallExternalDependencies )
8
+
9
+ add_subdirectory (Sources )
Original file line number Diff line number Diff line change
1
+ add_library (Subprocess )
2
+
3
+ add_subdirectory (_SubprocessCShims )
4
+ add_subdirectory (Subprocess )
5
+
6
+ target_compile_options (Subprocess PRIVATE
7
+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature StrictConcurrency>"
8
+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NonescapableTyeps>"
9
+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature LifetimeDependence>"
10
+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature Span>" )
11
+
12
+ target_link_libraries (Subprocess PRIVATE SystemPackage )
Original file line number Diff line number Diff line change
1
+ target_sources (Subprocess PRIVATE
2
+ Execution.swift
3
+ Buffer.swift
4
+ Error.swift
5
+ Teardown.swift
6
+ Result.swift
7
+ IO/Output.swift
8
+ IO/Input.swift
9
+ Span+Subprocess.swift
10
+ AsyncBufferSequence.swift
11
+ API.swift
12
+ SubprocessFoundation/Span+SubprocessFoundation.swift
13
+ SubprocessFoundation/Output+Foundation.swift
14
+ SubprocessFoundation/Input+Foundation.swift
15
+ Configuration .swift )
16
+
17
+ if (WIN32 )
18
+ target_sources (Subprocess PRIVATE Platforms/Subprocess+Windows.swift )
19
+ elseif (LINUX OR ANDROID )
20
+ target_sources (Subprocess PRIVATE
21
+ Platforms/Subprocess+Linux.swift
22
+ Platforms/Subprocess+Unix.swift )
23
+ elseif (APPLE )
24
+ target_sources (Subprocess PRIVATE
25
+ Platforms/Subprocess+Darwin.swift
26
+ Platforms/Subprocess+Unix.swift )
27
+ endif ()
Original file line number Diff line number Diff line change
1
+ target_sources (Subprocess PRIVATE process_shims.c )
2
+
3
+ target_include_directories (Subprocess PRIVATE
4
+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include>" )
Original file line number Diff line number Diff line change
1
+ module _SubprocessCShims {
2
+ header "process_shims.h"
3
+ header "target_conditionals.h"
4
+ }
Original file line number Diff line number Diff line change
1
+ include_guard ()
2
+
3
+ # TODO: Use find_package to find a pre-built SwiftSystem
4
+
5
+ include (FetchContent )
6
+
7
+ FetchContent_Declare (SwiftSystem
8
+ GIT_REPOSITORY https://github.com/apple/swift-system.git
9
+ GIT_TAG a34201439c74b53f0fd71ef11741af7e7caf01e1 # 1.4.2
10
+ GIT_SHALLOW YES )
11
+ list (APPEND dependencies SwiftSystem )
12
+
13
+
14
+ if (dependencies )
15
+ FetchContent_MakeAvailable (${dependencies} )
16
+ endif ()
You can’t perform that action at this time.
0 commit comments