mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
31 lines
928 B
CMake
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()
|