Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 22 additions & 26 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ jobs:
strategy:
matrix:
include:
- os: linux
runs-on: ubuntu-latest
arch: amd64
- os: darwin
runs-on: macos-latest
arch: amd64
- os: darwin
runs-on: macos-latest
arch: arm64
- os: windows
runs-on: windows-latest
arch: amd64
Expand All @@ -41,17 +32,7 @@ jobs:
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y sqlite3 libsqlite3-dev build-essential

- name: Install dependencies (macOS)
if: matrix.os == 'darwin'
run: |
brew install sqlite3

- name: Install dependencies (Windows)
if: matrix.os == 'windows'
run: |
choco install sqlite
sudo apt-get install -y libsqlite3-dev build-essential

- name: Build SQLite (Unix)
if: matrix.os != 'windows'
Expand All @@ -68,6 +49,12 @@ jobs:
make
make install

- name: Setup MSVC (Windows)
if: matrix.os == 'windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64

- name: Build SQLite (Windows)
if: matrix.os == 'windows'
run: |
Expand All @@ -78,10 +65,19 @@ jobs:
Rename-Item sqlite-autoconf-3450100 sqlite-latest
}
cd sqlite-latest
# Use MSYS2/MinGW for Windows build
bash -c "./configure --prefix=$(pwd)/../install --enable-static --disable-shared 'CFLAGS=-DSQLITE_ENABLE_DBPAGE_VTAB=1 -O2'"
bash -c "make"
bash -c "make install"
# Use Visual Studio tools for Windows build as recommended by SQLite docs
nmake /f Makefile.msc clean
nmake /f Makefile.msc sqlite3.c
nmake /f Makefile.msc sqlite3.exe
# Create install directory structure
New-Item -ItemType Directory -Force -Path "../install/bin"
New-Item -ItemType Directory -Force -Path "../install/include"
New-Item -ItemType Directory -Force -Path "../install/lib"
# Copy built files to install directory
Copy-Item "sqlite3.exe" "../install/bin/"
Copy-Item "sqlite3.h" "../install/include/"
Copy-Item "sqlite3ext.h" "../install/include/"
if (Test-Path "sqlite3.lib") { Copy-Item "sqlite3.lib" "../install/lib/" }

- name: Build Bridge
run: |
Expand Down Expand Up @@ -126,8 +122,8 @@ jobs:
if: matrix.os == 'windows'
run: |
cd client
# Use make with MSYS2/MinGW
bash -c "make build"
# MSVC environment is already set up from previous step
make build

- name: Create release directory
run: |
Expand Down
6 changes: 2 additions & 4 deletions bridge/sqlite_rsync.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#define SQLITE_ENABLE_DBPAGE_VTAB 1
#define SQLITE_RSYNC_NO_MAIN
#define SQLITE_RSYNC_USE_H

#ifndef SQLITE_RSYNC_C_INCLUDED
#define SQLITE_RSYNC_C_INCLUDED
Expand Down Expand Up @@ -126,7 +124,7 @@ static void win32_fatal_error(const char *zMsg)
fprintf(stderr, "%s", zMsg);
exit(1);
}
extern int _open_osfhandle(intptr_t, int);
#include <io.h> /* For _open_osfhandle */
#else
#include <unistd.h>
#include <signal.h>
Expand Down Expand Up @@ -175,7 +173,7 @@ extern int sqlite3_sha_init(
**
** Return the number of errors.
*/
static int win32_create_child_process(
int win32_create_child_process(
wchar_t *zCmd, /* The command that the child process will run */
HANDLE hIn, /* Standard input */
HANDLE hOut, /* Standard output */
Expand Down
2 changes: 0 additions & 2 deletions bridge/sqlite_rsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
** similar to "rsync".
*/

#define SQLITE_RSYNC_USE_H

#ifndef SQLITE_RSYNC_H_INCLUDED
#define SQLITE_RSYNC_H_INCLUDED

Expand Down
7 changes: 4 additions & 3 deletions bridge/sqlite_rsync_wrapper.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#define SQLITE_RSYNC_NO_MAIN
#define SQLITE_RSYNC_USE_H

#include "sqlite_rsync.h"
#include "sqlite_rsync_wrapper.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#include <process.h>
#else
#include <unistd.h>
#include <sys/wait.h>
#endif

#ifndef SQLITE_RSYNC_WRAPPER_C_INCLUDED
#define SQLITE_RSYNC_WRAPPER_C_INCLUDED
Expand Down
Loading