Skip to content

Commit

Permalink
Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
frederoni committed Jan 15, 2018
1 parent e4c262d commit c003c95
Show file tree
Hide file tree
Showing 13 changed files with 113 additions and 88 deletions.
21 changes: 0 additions & 21 deletions Makefile

This file was deleted.

8 changes: 3 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ let package = Package(
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Turf",
dependencies: [],
path: "Sources"),
dependencies: []),
.testTarget(
name: "Tests",
dependencies: ["Turf"],
path: "Tests"),
name: "TurfTests",
dependencies: ["Turf"]),
]
)
17 changes: 17 additions & 0 deletions Sources/CoreLocation.swift → Sources/Turf/CoreLocation.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
import Foundation
#if os(Linux)
public struct CLLocationCoordinate2D {
let latitude: Double
let longitude: Double
}

public class CLLocation {}

public typealias CLLocationDirection = Double
public typealias CLLocationDistance = Double
public typealias CLLocationDegrees = Double

let CLLocationDistanceMax: CLLocationDistance = .greatestFiniteMagnitude

#else
import CoreLocation
#endif

#if os(OSX)
let CLLocationDistanceMax: CLLocationDistance = .greatestFiniteMagnitude
Expand Down
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions Sources/Turf.swift → Sources/Turf/Turf.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#if os(Linux)
import Glibc
import SwiftShims
#else
import CoreLocation
#endif

public typealias LocationRadians = Double
public typealias RadianDistance = Double
Expand Down
6 changes: 6 additions & 0 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import XCTest
@testable import Turf

XCTMain([
testCase(TurfTests.allTests)
])
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
144 changes: 82 additions & 62 deletions Turf.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

0 comments on commit c003c95

Please sign in to comment.