tjarratt / fake4swift

A small CLI for generating Swift test doubles
MIT License
24 stars 3 forks source link

Fix fake4swift duplicate symbol warnings #5

Closed briancroom closed 8 years ago

briancroom commented 8 years ago

Xcode always statically links the Swift stdlib into CLI applications. Combined with the dynamically-linked stdlib loaded by the various frameworks leads to these warnings about two instances of these symbols existing in the process.

This PR works around that problem by building fake4swift as a Mac app, which dynamically links the stdlib, and then copying the binary and embedded frameworks out of the .app and into the installation directory. This technique was first (AFAICT) popularized by Carthage (see https://github.com/Carthage/Carthage/pull/16 or https://github.com/Carthage/Commandant/issues/28), which has a similar setup.

tjarratt commented 8 years ago

This is awesome!