Skip to content

Commit 65b6ff6

Browse files
committed
Add Swift Package Manager support
1 parent 8355b88 commit 65b6ff6

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

Package.swift

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// swift-tools-version:5.0
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "tommath",
8+
platforms: [
9+
.macOS(.v10_10), .iOS(.v9), .tvOS(.v9)
10+
],
11+
products: [
12+
// Products define the executables and libraries a package produces, and make them visible to other packages.
13+
.library(
14+
name: "libtommath",
15+
targets: ["libtommath"])
16+
],
17+
dependencies: [
18+
// Dependencies declare other packages that this package depends on.
19+
// .package(url: /* package url */, from: "1.0.0"),
20+
],
21+
targets: [
22+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
23+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
24+
.target(
25+
name: "libtommath",
26+
path: ".",
27+
exclude: ["demo", "doc", "etc", "logs", "mtest"],
28+
sources: ["."],
29+
publicHeadersPath: "modulemap",
30+
cSettings: [
31+
.headerSearchPath(".")
32+
])
33+
],
34+
cLanguageStandard: .gnu11,
35+
cxxLanguageStandard: .gnucxx14
36+
)

modulemap/module.modulemap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module libtommath [extern_c] {
2+
header "../tommath.h"
3+
export *
4+
}

0 commit comments

Comments
 (0)