File tree Expand file tree Collapse file tree 4 files changed +31
-27
lines changed Expand file tree Collapse file tree 4 files changed +31
-27
lines changed Original file line number Diff line number Diff line change 99##
1010##===----------------------------------------------------------------------===##
1111
12- add_library (Subprocess)
13-
1412add_subdirectory (_SubprocessCShims)
1513add_subdirectory (Subprocess)
16-
17- target_compile_options (Subprocess PRIVATE
18- "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature StrictConcurrency>"
19- "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NonescapableTyeps>"
20- "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature LifetimeDependence>"
21- "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature Span>" )
22-
23- target_link_libraries (Subprocess PRIVATE SystemPackage)
Original file line number Diff line number Diff line change 99##
1010##===----------------------------------------------------------------------===##
1111
12- target_sources (Subprocess PRIVATE
12+ add_library (Subprocess
1313 Execution.swift
1414 Buffer.swift
1515 Error.swift
@@ -24,9 +24,9 @@ target_sources(Subprocess PRIVATE
2424 SubprocessFoundation/Output +Foundation.swift
2525 SubprocessFoundation/Input +Foundation.swift
2626 Configuration .swift)
27-
2827if (WIN32 )
29- target_sources (Subprocess PRIVATE Platforms/Subprocess+Windows.swift)
28+ target_sources (Subprocess PRIVATE
29+ Platforms/Subprocess+Windows.swift)
3030elseif (LINUX OR ANDROID)
3131 target_sources (Subprocess PRIVATE
3232 Platforms/Subprocess+Linux.swift
@@ -36,3 +36,13 @@ elseif(APPLE)
3636 Platforms/Subprocess+Darwin.swift
3737 Platforms/Subprocess+Unix .swift)
3838endif ()
39+
40+ target_compile_options (Subprocess PRIVATE
41+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature StrictConcurrency>"
42+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature NonescapableTyeps>"
43+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature LifetimeDependence>"
44+ "$<$<COMPILE_LANGUAGE:Swift>:SHELL:-enable-experimental-feature Span>" )
45+ target_link_libraries (Subprocess PUBLIC
46+ _SubprocessCShims)
47+ target_link_libraries (Subprocess PRIVATE
48+ SwiftSystem::SystemPackage)
Original file line number Diff line number Diff line change 99##
1010##===----------------------------------------------------------------------===##
1111
12- target_sources (Subprocess PRIVATE process_shims.c)
13-
14- target_include_directories (Subprocess PRIVATE
15- "$<BUILD_INTERFACE: ${CMAKE_CURRENT_SOURCE_DIR} / include>" )
12+ add_library (_SubprocessCShims STATIC
13+ process_shims.c)
14+ target_include_directories (_SubprocessCShims PUBLIC
15+ include )
Original file line number Diff line number Diff line change 1111
1212include_guard ()
1313
14- # TODO: Use find_package to find a pre-built SwiftSystem
15-
1614include (FetchContent)
1715
18- FetchContent_Declare(SwiftSystem
19- GIT_REPOSITORY https://github.com/apple /swift-system .git
20- GIT_TAG a34201439c74b53f0fd71ef11741af7e7caf01e1 # 1.4.2
21- GIT_SHALLOW YES )
22- list (APPEND dependencies SwiftSystem)
23-
16+ find_package (SwiftSystem QUIET )
17+ if (NOT SwiftSystem_FOUND)
18+ message ("-- Vendoring swift-system" )
19+ FetchContent_Declare(SwiftSystem
20+ GIT_REPOSITORY https://github.com/apple /swift-system .git
21+ GIT_TAG a34201439c74b53f0fd71ef11741af7e7caf01e1 # 1.4.2
22+ GIT_SHALLOW YES )
23+ list (APPEND VendoredDependencies SwiftSystem)
24+ endif ()
2425
25- if (dependencies)
26- FetchContent_MakeAvailable(${dependencies} )
26+ if (VendoredDependencies)
27+ FetchContent_MakeAvailable(${VendoredDependencies} )
28+ if (NOT TARGET SwiftSystem::SystemPackage)
29+ add_library (SwiftSystem::SystemPackage ALIAS SystemPackage)
30+ endif ()
2731endif ()
You can’t perform that action at this time.
0 commit comments