Skip to content

Commit 0ff4ac6

Browse files
committed
build: fix the build of the toolchain
This wires up the new macro properly into the build machinery to ensure that the `distribution` target properly builds and installs the dependencies. This fixes the missing `swift-plugin-server` on Windows.
1 parent 48b9593 commit 0ff4ac6

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

cmake/modules/AddPureSwift.cmake

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ function(add_pure_swift_host_tool name)
269269

270270
# Option handling
271271
set(options)
272-
set(single_parameter_options)
272+
set(single_parameter_options
273+
SWIFT_COMPONENT)
273274
set(multiple_parameter_options
274275
DEPENDENCIES
275276
SWIFT_DEPENDENCIES)
@@ -323,6 +324,17 @@ function(add_pure_swift_host_tool name)
323324
target_include_directories(${name} PUBLIC
324325
${SWIFT_HOST_LIBRARIES_DEST_DIR})
325326

326-
# Export this target.
327-
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
327+
if(NOT APSHT_SWIFT_COMPONENT STREQUAL no_component)
328+
add_dependencies(${APSHT_SWIFT_COMPONENT} ${name})
329+
swift_install_in_component(TARGETS ${name}
330+
COMPONENT ${APSHT_SWIFT_COMPONENT}
331+
RUNTIME DESTINATION bin)
332+
swift_is_installing_component(${APSHT_SWIFT_COMPONENT} is_installing)
333+
endif()
334+
335+
if(NOT is_installing)
336+
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
337+
else()
338+
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
339+
endif()
328340
endfunction()

tools/swift-plugin-server/CMakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ if (SWIFT_SWIFT_PARSER)
1616
DEPENDENCIES
1717
swiftDemangling
1818
$<TARGET_OBJECTS:_swiftCSwiftPluginServer>
19+
SWIFT_COMPONENT
20+
compiler
1921
SWIFT_DEPENDENCIES
2022
SwiftSyntax::SwiftSyntaxMacros
2123
SwiftSyntax::SwiftSyntaxMacroExpansion
@@ -25,9 +27,4 @@ if (SWIFT_SWIFT_PARSER)
2527
target_include_directories(swift-plugin-server PRIVATE
2628
Sources/CSwiftPluginServer/include
2729
)
28-
swift_install_in_component(TARGETS swift-plugin-server
29-
RUNTIME
30-
DESTINATION bin
31-
COMPONENT compiler
32-
)
3330
endif()

0 commit comments

Comments
 (0)