swift-server / swift-backtrace

💥 Backtraces for Swift on Linux and Windows
Apache License 2.0
296 stars 34 forks source link

feat: cross-compilation #17

Closed ianpartridge closed 5 years ago

ianpartridge commented 5 years ago

It's best practice to avoid platform conditional code in Package.swift.

  1. Change the vendoring script so it wraps all the C code in #ifdef __linux__, so it can compile on macOS too (but does nothing).
  2. Re-run the script so the C code is appropriately wrapped.
  3. Update the Package.swift files to remove the conditional compilation.

Result: happy cross-compilers

Fixes: #16

CC: @weissi