Commit Graph

10 Commits

Author SHA1 Message Date
Rintaro Ishizaki
9a881cb91a [CMake] Set CMAKE_{C|CXX}_COMPILER_TARGET for swift-syntax
swift-syntax now have '.c' sources. We need to set this for
cross-compiling.
2025-01-09 10:20:10 -08:00
Rintaro Ishizaki
1fae9d7697 [CMake] Explicit library evolution for toolchain swift-syntax libraries
`SWIFTSYNTAX_EMIT_MODULE` is going to be `OFF` by default.
2024-10-02 16:50:59 -07:00
Doug Gregor
cec43b11d2 Make sure we install the compiler's SwiftIfConfig library
Fixes rdar://135923606.
2024-09-16 13:24:47 -07:00
Rintaro Ishizaki
4a39290491 [CMake] Exclude swift-syntax targets from 'all'
We only want swift-syntax libraries as dependencies
2024-09-09 17:13:59 -07:00
Rintaro Ishizaki
371dfe860e [CMake] Build macro plugin and plugin servers as a package
Build 'lib/swift/host' libraries and linking binaries as a single
"package" instead of buillding the linking binaries with
"prefer-interface" hack.
This enables CMO between them.
2024-08-28 15:03:05 -07:00
Rintaro Ishizaki
be419a3428 [Macros] Use 'LibraryPluginProvider' in swift-plugin-server
Move 'PluginProvider' logic to 'SwiftLibraryPluginProvider' module
so the compiler can reuse that logic for the actual in-process plugins.
2024-05-07 09:47:04 -07:00
eeckstein
9504de5ed7 Merge pull request #71552 from finagolfin/cross-compile
[CMake] Add broader support for cross-compiling the portions of the compiler that are written in Swift to non-Darwin Unix
2024-03-15 16:28:38 +01:00
Alex Hoppen
3a65e1085b [Build] Build SwiftRefactor module from swift-syntax
sourcekit-lsp will be using this in https://github.com/apple/sourcekit-lsp/pull/1072 and Windows uses the swift-syntax modules from the compiler build for sourcekit-lsp.
2024-02-29 09:43:22 -08:00
Finagolfin
fcf7614638 [CMake] Add broader support for cross-compiling the portions of the compiler that are written in Swift to non-Darwin Unix
Add cross-compilation flags for the newly added Swift source in `lib/ASTGen/`,
similar to how `SwiftCompilerSources/` is already cross-compiled for other
platforms. Make sure the Swift source in the compiler builds and links against
`SWIFTLIB_DIR` in this cross-compilation build directory, not the one that comes
with the native host compiler.

This requires changing the dependency chain in `CROSSCOMPILE` mode, as normally
the Swift compiler is built first when building natively for the host, then it's
used to build the stdlib. However, when cross-compiling the toolchain, the stdlib
must be cross-compiled first by the host compiler, then the portions of the
Swift compiler written in Swift must be cross-compiled with that new stdlib. All
these dependency changes simply change that compilation order when cross-compiling,
including removing the dependency that the Swift compiler is built before the
stdlib when cross-compiling the Swift compiler.

All changes in this pull are gated on the `CROSSCOMPILE` mode, so they will
not affect any of the existing CI or build presets.
2024-02-13 12:24:24 +05:30
Rintaro Ishizaki
2d527c41db [CMake] Move swift-syntax library definitions to 'lib/SwiftSyntax'
Previously, swift-syntax libraries were built in '/CMakeLists.txt', and
were installed in '/lib/CMakeLists.txt'. Consolidate them into
'/lib/SwiftSyntax/CMakeLists.txt'. Now the swift-syntax libraries look
like any other tool libraries outside the 'lib/SwiftSyntax', as they
should.
2024-01-12 12:52:55 -08:00