Skip to content

build: fix the build of the toolchain #68366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions cmake/modules/AddPureSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ function(add_pure_swift_host_tool name)

# Option handling
set(options)
set(single_parameter_options)
set(single_parameter_options
SWIFT_COMPONENT)
set(multiple_parameter_options
DEPENDENCIES
SWIFT_DEPENDENCIES)
Expand Down Expand Up @@ -341,6 +342,18 @@ function(add_pure_swift_host_tool name)
COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/${name}.swiftmodule"
COMMAND_EXPAND_LISTS
COMMENT "Update mtime of executable outputs workaround")
# Export this target.
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})

if(NOT APSHT_SWIFT_COMPONENT STREQUAL no_component)
add_dependencies(${APSHT_SWIFT_COMPONENT} ${name})
swift_install_in_component(TARGETS ${name}
COMPONENT ${APSHT_SWIFT_COMPONENT}
RUNTIME DESTINATION bin)
swift_is_installing_component(${APSHT_SWIFT_COMPONENT} is_installing)
endif()

if(NOT is_installing)
set_property(GLOBAL APPEND PROPERTY SWIFT_BUILDTREE_EXPORTS ${name})
else()
set_property(GLOBAL APPEND PROPERTY SWIFT_EXPORTS ${name})
endif()
endfunction()
7 changes: 2 additions & 5 deletions tools/swift-plugin-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ if (SWIFT_SWIFT_PARSER)
DEPENDENCIES
swiftDemangling
$<TARGET_OBJECTS:_swiftCSwiftPluginServer>
SWIFT_COMPONENT
compiler
SWIFT_DEPENDENCIES
SwiftSyntax::SwiftSyntaxMacros
SwiftSyntax::SwiftSyntaxMacroExpansion
Expand All @@ -25,9 +27,4 @@ if (SWIFT_SWIFT_PARSER)
target_include_directories(swift-plugin-server PRIVATE
Sources/CSwiftPluginServer/include
)
swift_install_in_component(TARGETS swift-plugin-server
RUNTIME
DESTINATION bin
COMPONENT compiler
)
endif()