-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from duckduckgo/develop
Make swift package
- Loading branch information
Showing
5 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: PR Checks | ||
|
||
on: | ||
push: | ||
branches: [ "develop" ] | ||
pull_request: | ||
branches: [ "develop" ] | ||
|
||
jobs: | ||
unit-tests: | ||
name: Unit Tests | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, macos-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Run tests | ||
run: ./run_test.sh | ||
shell: bash | ||
|
||
- name: Run Swift build | ||
run: | | ||
swift build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.idea | ||
cmake-build-debug | ||
build | ||
build | ||
.swiftpm/ | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// swift-tools-version: 5.7 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "BloomFilter", | ||
platforms: [ | ||
.iOS(.v14), | ||
.macOS(.v10_15) | ||
], | ||
products: [ | ||
.library( | ||
name: "BloomFilter", | ||
targets: ["BloomFilter"] | ||
), | ||
], | ||
targets: [ | ||
.target( | ||
name: "BloomFilter", | ||
path: "src", | ||
sources: ["BloomFilter.cpp"], | ||
publicHeadersPath: "." | ||
) | ||
], | ||
cxxLanguageStandard: .cxx11 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
directory=`dirname $0` | ||
mkdir $directory/build; | ||
(cd $directory/build; cmake ..; make all;) | ||
$directory/build/test/RunTests | ||
#!/usr/bin/env bash | ||
|
||
directory=$(dirname "$0") | ||
mkdir "$directory"/build; | ||
(cd "$directory"/build || exit; cmake ..; make all;) | ||
"$directory"/build/test/RunTests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
|
||
if(APPLE) | ||
include_directories(/usr/local/opt/openssl/include) | ||
link_directories(/usr/local/opt/openssl/lib) | ||
if(EXISTS /usr/local/opt/openssl/) | ||
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl) | ||
elseif(EXISTS /opt/homebrew/opt/[email protected]/) | ||
set(OPENSSL_ROOT_DIR /opt/homebrew/opt/[email protected]) | ||
endif() | ||
endif() | ||
|
||
link_libraries(crypto) | ||
add_executable (GenerateFilter GenerateFilter.cpp) | ||
find_package (OpenSSL REQUIRED) | ||
|
||
if(APPLE) | ||
target_link_libraries (GenerateFilter LINK_PUBLIC BloomFilter crypto) | ||
else() | ||
target_link_libraries (GenerateFilter LINK_PUBLIC BloomFilter) | ||
endif() | ||
add_executable (GenerateFilter GenerateFilter.cpp) | ||
target_link_libraries (GenerateFilter LINK_PUBLIC BloomFilter OpenSSL::Crypto) |