Skip to content

Commit

Permalink
Merge branch 'release/1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
heyzooi committed Oct 6, 2018
2 parents fdcea8d + 0744d43 commit cfeda5b
Show file tree
Hide file tree
Showing 29 changed files with 1,088 additions and 17 deletions.
31 changes: 31 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,35 @@ task:
name: macOS
osx_instance:
image: high-sierra-xcode-9.4.1
env:
PATH: $PATH:/usr/local/share/dotnet
git_submodule_update_init_script: git submodule update --init --recursive
brew_update_script: brew update
install_pkg-config_script: brew install pkg-config
install_sqlite_script: brew install sqlite3
test_script: make test
swift_pm_test_script: cd swift; swift build && swift test
swift_test_script: cd swift; swift package generate-xcodeproj --xcconfig-overrides SQLiteCryptoVFS.xcconfig && xcodebuild -scheme SQLiteCryptoVFS-Package test
install_dotnet_script: brew cask install dotnet-sdk
dotnet_test_script: cd dotnet/SQLiteCryptoVFS.Tests; dotnet test

task:
name: Swift Linux
container:
image: swift
git_submodule_update_init_script: git submodule update --init --recursive
apt_update_script: apt update
install_sqlite_script: apt install libsqlite3-dev
swift_pm_test_script: cd swift; swift build && swift test

task:
name: .Net Linux
container:
image: microsoft/dotnet
git_submodule_update_init_script: git submodule update --init --recursive
apt_update_script: apt update
install_build-essential_script: apt install build-essential -y
install_sqlite_script: apt install libsqlite3-dev -y
install_pkg-config_script: apt install pkg-config -y
test_script: make test
dotnet_test_script: cd dotnet/SQLiteCryptoVFS.Tests; dotnet test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ modules.order
Module.symvers
Mkfile.old
dkms.conf

# SQLite
**/test-encrypted.db
36 changes: 30 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,42 @@
CC = gcc
CXX = g++
LD = gcc
CFLAGS = $(shell pkg-config --libs sqlite3) $(shell pkg-config --cflags sqlite3)
CXXFLAGS = -g $(CFLAGS) -lsqlite-crypto-vfs -L.
UNAME = $(shell uname)
CFLAGS = $(shell pkg-config --libs sqlite3) $(shell pkg-config --cflags sqlite3) -fPIC
ARCH = $(shell getconf LONG_BIT)
DUMPMACHINE = $(shell $(CC) -dumpmachine -m$(ARCH))
CXXFLAGS = -g $(CFLAGS) -lsqlite-crypto-vfs -Llib/$(DUMPMACHINE)
SQLITE_CRYPTO_VFS_SOURCE = aes.c sqlite-crypto-vfs.c

ifeq ($(UNAME), Linux)
LIB_PREFIX = lib
LIB_SUFFIX = .so
endif
ifeq ($(UNAME), Darwin)
LIB_PREFIX = lib
LIB_SUFFIX = .dylib
endif

default: build

clean:
rm -Rf lib
rm -f test

build: sqlite-crypto-vfs

sqlite-crypto-vfs:
$(CC) $(CFLAGS) -shared -o libsqlite-crypto-vfs.dylib aes.c sqlite-crypto-vfs.c
sqlite-crypto-vfs-arch64:
mkdir -p lib/$(DUMPMACHINE)
$(CC) $(CFLAGS) -shared -m64 -o lib/$(DUMPMACHINE)/$(LIB_PREFIX)sqlite-crypto-vfs$(LIB_SUFFIX) $(SQLITE_CRYPTO_VFS_SOURCE)

sqlite-crypto-vfs-arch32:
mkdir -p lib/$(DUMPMACHINE)
$(CC) $(CFLAGS) -shared -m32 -o lib/$(DUMPMACHINE)/$(LIB_PREFIX)sqlite-crypto-vfs$(LIB_SUFFIX) $(SQLITE_CRYPTO_VFS_SOURCE)

sqlite-crypto-vfs: sqlite-crypto-vfs-arch$(ARCH)
@echo "*** BUILD SUCCESSFUL ***"

test-build: sqlite-crypto-vfs
$(CXX) $(CXXFLAGS) -o test test.cpp

test: test-build
DYLD_LIBRARY_PATH=tiny-AES-c ./test
LD_LIBRARY_PATH=./lib/$(DUMPMACHINE) ./test
Loading

0 comments on commit cfeda5b

Please sign in to comment.