Skip to content
  • Evan Wilde's avatar
    Swift/Ninja: Split compilation model · 9bed4f4d
    Evan Wilde authored
    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...
    9bed4f4d