Files
swift-mirror/tools/swift-plugin-server/CMakeLists.txt
Rintaro Ishizaki 9c9010e5b7 [CMake] Support Macros in Linux
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.
2023-08-24 17:04:15 +00:00

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()