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 9
9
##
10
10
##===----------------------------------------------------------------------===##
11
11
12
- add_library (Subprocess )
13
-
14
12
add_subdirectory (_SubprocessCShims )
15
13
add_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 9
9
##
10
10
##===----------------------------------------------------------------------===##
11
11
12
- target_sources (Subprocess PRIVATE
12
+ add_library (Subprocess
13
13
Execution.swift
14
14
Buffer.swift
15
15
Error.swift
@@ -24,9 +24,9 @@ target_sources(Subprocess PRIVATE
24
24
SubprocessFoundation/Output+Foundation.swift
25
25
SubprocessFoundation/Input+Foundation.swift
26
26
Configuration .swift )
27
-
28
27
if (WIN32 )
29
- target_sources (Subprocess PRIVATE Platforms/Subprocess+Windows.swift )
28
+ target_sources (Subprocess PRIVATE
29
+ Platforms/Subprocess+Windows.swift )
30
30
elseif (LINUX OR ANDROID )
31
31
target_sources (Subprocess PRIVATE
32
32
Platforms/Subprocess+Linux.swift
@@ -36,3 +36,13 @@ elseif(APPLE)
36
36
Platforms/Subprocess+Darwin.swift
37
37
Platforms/Subprocess+Unix.swift )
38
38
endif ()
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 9
9
##
10
10
##===----------------------------------------------------------------------===##
11
11
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 11
11
12
12
include_guard ()
13
13
14
- # TODO: Use find_package to find a pre-built SwiftSystem
15
-
16
14
include (FetchContent )
17
15
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 ()
24
25
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 ()
27
31
endif ()
You can’t perform that action at this time.
0 commit comments