Skip to content

Commit 881d6f9

Browse files
authored
Merge pull request #68366 from compnerd/cut-the-wire
build: fix the build of the toolchain
2 parents 57e56a0 + c8e36f6 commit 881d6f9

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

cmake/modules/AddPureSwift.cmake

Lines changed: 16 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)
@@ -341,6 +342,18 @@ function(add_pure_swift_host_tool name)
341342
COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/${name}.swiftmodule"
342343
COMMAND_EXPAND_LISTS
343344
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()
346359
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)