CMake/Tests/SwiftOnly
Evan Wilde 9bed4f4d81
Swift/Ninja: Split compilation model
Splitting the Swift build into an object build and a separate link step,
instead of building and linking in one step. The immediate benefit is
LSP support because we are able to emit compile-commands for Swift files
now. Additionally, it is possible to specify flags to the compile step,
enabling folks to emit C and C++ headers from their Swift builds for
C/C++ interop, without needing custom commands. Eventually, this gives
us a path toward working object libraries.

Object Libraries:
 - Object libraries don't work today because CMake doesn't emit targets
   for object libraries into the Ninja build file.
 - tl;dr: Object libraries work if they aren't WMO. Still need work to
   make WMO'd object libraries work.

   Object libraries still don't completely work with this patch because,
   while we emit the targets, the `TARGET_OBJECTS` generator expression
   expansion has a separate mechanism for determining what the names of
   the objects are based on the input source files, so targets that
   depend on an object library built with a whole-module optimization
   will depend on objects based on the name of the source file instead
   of the actual emitted object file.

These features require being able to accurately model wholemodule builds
though, because we actually need to track object files and WMO affects
what objects are emitted. For that, we require CMP0157 use the NEW
policy. When it's OLD, we have to fall back on the old behavior and
cannot provide object libraries or the compile-commands for LSP.

Issue: #25308
2023-12-15 05:51:13 -08:00
..
SubA Xcode: Implement Swift include directories 2022-11-02 17:03:21 -04:00
SubB Xcode: Implement Swift include directories 2022-11-02 17:03:21 -04:00
SwiftPlugin Ninja: Emit swiftmodule from executable with exports 2023-01-19 11:49:24 -08:00
CMakeLists.txt Swift/Ninja: Split compilation model 2023-12-15 05:51:13 -08:00
L.swift
M.swift
main.swift Xcode: Pass compile definitions to Swift 2022-07-07 15:00:32 +02:00
N.swift
O.swift Swift/Ninja: Split compilation model 2023-12-15 05:51:13 -08:00