File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed
tools/swift-plugin-server Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,8 @@ function(add_pure_swift_host_tool name)
269
269
270
270
# Option handling
271
271
set (options )
272
- set (single_parameter_options )
272
+ set (single_parameter_options
273
+ SWIFT_COMPONENT )
273
274
set (multiple_parameter_options
274
275
DEPENDENCIES
275
276
SWIFT_DEPENDENCIES )
@@ -341,6 +342,18 @@ function(add_pure_swift_host_tool name)
341
342
COMMAND "${CMAKE_COMMAND} " -E touch "${CMAKE_CURRENT_BINARY_DIR} /${name} .swiftmodule"
342
343
COMMAND_EXPAND_LISTS
343
344
COMMENT "Update mtime of executable outputs workaround" )
344
- # Export this target.
345
- set_property (GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name} )
345
+
346
+ if (NOT APSHT_SWIFT_COMPONENT STREQUAL no_component )
347
+ add_dependencies (${APSHT_SWIFT_COMPONENT} ${name} )
348
+ swift_install_in_component (TARGETS ${name}
349
+ COMPONENT ${APSHT_SWIFT_COMPONENT}
350
+ RUNTIME DESTINATION bin )
351
+ swift_is_installing_component (${APSHT_SWIFT_COMPONENT} is_installing )
352
+ endif ()
353
+
354
+ if (NOT is_installing )
355
+ set_property (GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name} )
356
+ else ()
357
+ set_property (GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name} )
358
+ endif ()
346
359
endfunction ()
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ if (SWIFT_SWIFT_PARSER)
16
16
DEPENDENCIES
17
17
swiftDemangling
18
18
$< TARGET_OBJECTS:_swiftCSwiftPluginServer>
19
+ SWIFT_COMPONENT
20
+ compiler
19
21
SWIFT_DEPENDENCIES
20
22
SwiftSyntax::SwiftSyntaxMacros
21
23
SwiftSyntax::SwiftSyntaxMacroExpansion
@@ -25,9 +27,4 @@ if (SWIFT_SWIFT_PARSER)
25
27
target_include_directories (swift-plugin-server PRIVATE
26
28
Sources /CSwiftPluginServer/include
27
29
)
28
- swift_install_in_component (TARGETS swift-plugin-server
29
- RUNTIME
30
- DESTINATION bin
31
- COMPONENT compiler
32
- )
33
30
endif ()
You can’t perform that action at this time.
0 commit comments