Skip to content

Commit d1a4bbf

Browse files
authored
Make swift package #19
1 parent 66b84a8 commit d1a4bbf

7 files changed

Lines changed: 50 additions & 4 deletions

File tree

.github/workflows/pr.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
with:
2020
submodules: recursive
2121

22-
- name: Run tests
22+
- name: Run CPP tests
2323
run: ./run_test.sh
2424
shell: bash
25+
26+
- name: Run Swift build
27+
run: |
28+
swift build
29+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.idea
2+
.swiftpm
3+
.build
24
cmake-build-debug
3-
build
5+
build

Package.swift

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// swift-tools-version:5.3
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
import Foundation
6+
7+
let package = Package(
8+
name: "BloomFilter",
9+
platforms: [
10+
.iOS("14.0"),
11+
.macOS("10.15")
12+
],
13+
products: [
14+
.library(name: "BloomFilter", targets: ["BloomFilter"]),
15+
],
16+
dependencies: [
17+
],
18+
targets: [
19+
.target(
20+
name: "BloomFilter",
21+
path: "src",
22+
resources: [
23+
.process("CMakeLists.txt")
24+
]),
25+
],
26+
cxxLanguageStandard: .cxx11
27+
)

src/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
cmake_minimum_required(VERSION 3.5)
22

3-
add_library(BloomFilter BloomFilter.hpp BloomFilter.cpp)
4-
target_include_directories(BloomFilter PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
3+
add_library(BloomFilter
4+
include/BloomFilter.hpp
5+
BloomFilter.cpp
6+
)
7+
8+
target_include_directories(BloomFilter
9+
PUBLIC
10+
${CMAKE_CURRENT_SOURCE_DIR}/include
11+
)

src/include/module.modulemap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module BloomFilter {
2+
header "BloomFilter.hpp"
3+
export *
4+
}
5+

test-bloom-filter.bin

8.97 KB
Binary file not shown.

0 commit comments

Comments
 (0)