mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
For compiling codes required for macro support, we now need swiftc compiler in the build machine. Unlike Darwin OSes, where swiftCore runtime is guaranteed to be present in /usr/lib, Linux doesn't have ABI stability and the stdlib of the build machine is not at the specific location. So the built compiler cannot relies on the shared object in the toolchain.
39 lines
1.1 KiB
CMake
39 lines
1.1 KiB
CMake
if (SWIFT_SWIFT_PARSER)
|
|
# _swiftCSwiftPluginServer is just a C support library for swift-plugin-server
|
|
# Don't bother to create '.a' for that.
|
|
add_swift_host_library(_swiftCSwiftPluginServer OBJECT
|
|
Sources/CSwiftPluginServer/PluginServer.cpp
|
|
)
|
|
target_link_libraries(_swiftCSwiftPluginServer PRIVATE
|
|
swiftDemangling
|
|
)
|
|
target_include_directories(_swiftCSwiftPluginServer PUBLIC
|
|
Sources/CSwiftPluginServer/include
|
|
)
|
|
|
|
add_pure_swift_host_tool(swift-plugin-server
|
|
Sources/swift-plugin-server/swift-plugin-server.swift
|
|
DEPENDENCIES
|
|
swiftDemangling
|
|
$<TARGET_OBJECTS:_swiftCSwiftPluginServer>
|
|
SWIFT_DEPENDENCIES
|
|
SwiftSyntax::SwiftSyntaxMacros
|
|
SwiftSyntax::SwiftSyntaxMacroExpansion
|
|
SwiftSyntax::SwiftCompilerPluginMessageHandling
|
|
swiftLLVMJSON
|
|
)
|
|
target_include_directories(swift-plugin-server PRIVATE
|
|
Sources/CSwiftPluginServer/include
|
|
)
|
|
swift_install_in_component(TARGETS swift-plugin-server
|
|
RUNTIME
|
|
DESTINATION bin
|
|
COMPONENT compiler
|
|
)
|
|
swift_install_strip_builder_rpath(
|
|
TARGETS swift-plugin-server
|
|
DESTINATION bin
|
|
COMPONENT compiler
|
|
)
|
|
endif()
|