Skip to content

Commit 725977b

Browse files
committed
SWIFT-47 create repository for swift libbson bindings
* added module map, and shim header * add spm Package.swift for module * add cocoapods podspec for module * fix podspec * add products to module
1 parent a179527 commit 725977b

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

Package.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// swift-tools-version:4.0
2+
import PackageDescription
3+
let package = Package(
4+
name: "libbson",
5+
pkgConfig: "libbson-1.0",
6+
providers: [
7+
.brew(["mongo-c-driver"]),
8+
.apt(["libbson-dev"])
9+
],
10+
products: [
11+
.library(name: "libbson", targets: ["libbson"])
12+
]
13+
)

SwiftBSON.podspec

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Pod::Spec.new do |spec|
2+
spec.name = "SwiftBSON"
3+
spec.version = "0.0.1"
4+
spec.summary = "Swift bindings for libbson"
5+
spec.homepage = "https://github.com/10gen/swift-bson"
6+
spec.license = "Apache License 2.0"
7+
spec.author = { "mbroadst" => "[email protected]" }
8+
spec.source = { :git => "ssh://[email protected]/10gen/swift-bson.git", :branch => "master" }
9+
10+
spec.osx.deployment_target = '10.9'
11+
spec.swift_version = '4.0'
12+
spec.requires_arc = true
13+
14+
spec.module_name = "libbson"
15+
spec.preserve_path = "module.modulemap"
16+
spec.module_map = "module.modulemap"
17+
end

libbson.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define BCON_H_
2+
#include <bson.h>

module.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module libbson [system] {
2+
header "libbson.h"
3+
link "bson-1.0"
4+
export *
5+
}

0 commit comments

Comments
 (0)