-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[CMake] Replace early swift-syntax with FetchContent #66043
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
Conversation
@swift-ci please test |
@swift-ci please build toolchain |
endif() | ||
|
||
set(BUILD_SHARED_LIBS_OLD "${BUILD_SHARED_LIBS}") | ||
set(BUILD_SHARED_LIBS ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this version of SwiftSyntax be used for building SourceKit-LSP? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally the SwiftSyntax used for LSP and the stress tester would be the one built from the just-built compiler rather than this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should match whatever was used to build the compiler installed in the toolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose what I should have said was "right now we...". @etcwilde brought up cross-compiling and that's a good point. So... maybe 🤔?
target_link_directories(${name} PUBLIC | ||
"${SWIFT_HOST_LIBRARIES_DEST_DIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some difference between lld
and ld64
. ld64
seems perfectly happy if the shared library is specified on the command line and there's a -l<thatLib>
in LC_LINKER_OPTION
but lld
certainly isn't. It's the same auto linking issue as #64409. We didn't hit this before because we were adding the lib/swift/host
from the early swift syntax build directory (and also only people using lld
would hit it anyway).
@swift-ci please clean test |
@swift-ci please clean build toolchain |
@swift-ci please test |
@swift-ci please test |
8d812cc
to
92ae57f
Compare
@swift-ci please test |
@swift-ci please test macOS platform |
8382b8f
to
0c02f78
Compare
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.
0c02f78
to
a3dbb20
Compare
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 inlib/swift/host
by passing downSWIFT_HOST_LIBRARIES_DEST_DIR
to avoid copying them as we were doing previously.