Skip to content

Commit a7aaabe

Browse files
committed
[skip ci] build(windows): Add AppVeyor workflow (IN PROGRESS)
1 parent c433beb commit a7aaabe

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

appveyor.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
image: Visual Studio 2019
2+
3+
install:
4+
# Install SQLite
5+
- ps: |
6+
$htmlContent = Invoke-WebRequest -Uri "https://sqlite.org/download.html" | Select-Object -ExpandProperty Content
7+
$regex = [regex]::new('PRODUCT,(\d+\.\d+\.\d+),(\d+/sqlite-amalgamation-\d+\.zip),\d+,(.+)')
8+
$match = $regex.Match($htmlContent)
9+
$relativeUrl = $match.Groups[2].Value
10+
$downloadLink = "https://sqlite.org/$relativeUrl"
11+
mkdir C:\temp\Win64
12+
Invoke-WebRequest -Uri $downloadLink -OutFile 'C:\temp\Win64\sqlite.zip'
13+
Expand-Archive -Path C:\temp\Win64\sqlite.zip -DestinationPath C:\temp\Win64
14+
Move-Item -Path C:\temp\Win64\sqlite-amalgamation-* C:\dev\SQLite-Win64
15+
cd C:\dev\SQLite-Win64
16+
cl sqlite3.c -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS -DSQLITE_ENABLE_STAT4 -DSQLITE_SOUNDEX -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_MATH_FUNCTIONS -DSQLITE_MAX_ATTACHED=125 -DSQLITE_API="__declspec(dllexport)" -link -dll -out:sqlite3.dll
17+
18+
# Install SQLite Extensions
19+
- ps: |
20+
cp .\src\extensions\extension-formats.c C:\dev\SQLite-Win64\
21+
cp .\src\extensions\extension-formats.def C:\dev\SQLite-Win64\
22+
cp .\src\extensions\extension-functions.c C:\dev\SQLite-Win64\
23+
cp .\src\extensions\extension-functions.def C:\dev\SQLite-Win64\
24+
cd C:\dev\SQLite-Win64\
25+
cl /MD extension-formats.c -link -dll -def:extension-formats.def -out:formats.dll
26+
cl /MD extension-functions.c -link -dll -def:extension-functions.def -out:math.dll
27+
# FIXME: Disable building the 'fileio' extension for now (#3488)
28+
# If this issue is resolved, be sure to delete the related patch for WiX
29+
# curl -L -o fileio.c "https://sqlite.org/src/raw?filename=ext/misc/fileio.c&ci=trunk"
30+
# curl -L -o test_windirent.c "https://sqlite.org/src/raw?filename=src/test_windirent.c&ci=trunk"
31+
# curl -L -o test_windirent.h "https://sqlite.org/src/raw?filename=src/test_windirent.h&ci=trunk"
32+
# cl /MD fileio.c test_windirent.c -link sqlite3.lib -dll -out:fileio.dll
33+
34+
# Install SQLCipher
35+
- ps: |
36+
cd C:\dev\SQLCipher-Win64
37+
git clean -fdx
38+
git fetch
39+
git reset --hard $(git describe --tags --abbrev=0)
40+
set CPPFLAGS="-DSQLITE_TEMP_STORE=2 -DSQLITE_HAS_CODEC=1 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_STAT4=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_JSON1=1 -DSQLITE_ENABLE_GEOPOLY=1 -DSQLITE_ENABLE_RTREE=1 -DSQLCIPHER_CRYPTO_OPENSSL=1 -DSQLITE_MAX_ATTACHED=125 -I"C:\dev\OpenSSL-Win64\include\""
41+
nmake /D /f Makefile.msc sqlcipher.dll USE_AMALGAMATION=1 NO_TCL=1 SQLITE3DLL=sqlcipher.dll SQLITE3LIB=sqlcipher.lib SQLITE3EXE=sqlcipher.exe LTLINKOPTS="C:\dev\OpenSSL-Win64\lib\libcrypto.lib"
42+
mkdir sqlcipher
43+
copy sqlite3.h sqlcipher
44+
45+
# Patch CMakeLists.txt and WiX Toolset Variables
46+
- ps: |
47+
git apply .github\patch\CMakeLists.txt.patch
48+
git apply .github\patch\product.wxs.patch
49+
git apply .github\patch\translations.wxs.patch
50+
git apply .github\patch\variables.wxi.patch
51+
52+
# Configure build (SQLite)
53+
- ps: |
54+
mkdir release-sqlite; cd release-sqlite
55+
cmake -G "Visual Studio 2019" -A "Win64" ..\
56+
57+
# Build (SQLie)
58+
- ps: cd release-sqlite; devenv /Build Release sqlitebrowser.sln /Project ALL_BUILD
59+
60+
61+
# Configure build (SQLCipher)
62+
- ps: |
63+
mkdir release-sqlcipher; cd release-sqlcipher
64+
cmake -G "Visual Studio 2019" -A "Win64" ..\
65+
66+
# Build (SQLCipher)
67+
- ps: cd release-sqlite; devenv /Build Release sqlitebrowser.sln /Project ALL_BUILD

0 commit comments

Comments
 (0)