Bersaelor / KDTree

Swift implementation of a k-dimensional binary space partitioning tree.
MIT License
153 stars 26 forks source link

Conditional compilation #32

Closed chriseidhof closed 6 years ago

chriseidhof commented 6 years ago

I tried creating an Xcode project out of this swift package generate-xcodeproj and it complained about CGPoint not being in Foundation. So I think we should do conditional compilation... WDYT?

Bersaelor commented 6 years ago

I'm surprised this caused a problem, given I use KDTree in this Server-Side-Swift project.

On Linux CGPoint is part of the swift foundation.

This should work:

#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
    import CoreGraphics
#endif
import Foundation

(Doing the same here) On Linux CGPoint is part of the swift foundation.

Bersaelor commented 6 years ago

PS: I'll also create a PR to run tests on linux-travis like in this project.