Files
swift-mirror/tools/swift-plugin-server/CMakeLists.txt
Ben Barham 041691184c [CMake] Replace early swift-syntax with FetchContent
Use FetchContent to include swift-syntax directly in swift. This can be
thought of as an `add_subdirectory` for a directory outside the root.

The default build directory will be `_deps/swiftsyntax-subbuild/`, though
the modules and shared libraries will be built in `lib/swift/host` by
passing down `SWIFT_HOST_LIBRARIES_DEST_DIR` to avoid copying them as we
were doing previously.
2023-09-18 14:44:10 -07:00

31 lines
928 B
CMake

if (SWIFT_BUILD_SWIFT_SYNTAX)
# _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_COMPONENT
compiler
SWIFT_DEPENDENCIES
SwiftSyntaxMacros
SwiftSyntaxMacroExpansion
SwiftCompilerPluginMessageHandling
swiftLLVMJSON
)
target_include_directories(swift-plugin-server PRIVATE
Sources/CSwiftPluginServer/include
)
endif()