Skip to content

Commit

Permalink
build: pre-compiled binaries for windows-x86 (#118)
Browse files Browse the repository at this point in the history
Close #117
  • Loading branch information
lucydodo authored Jun 2, 2024
1 parent c7095bc commit c896e04
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,19 @@ jobs:
make compile-linux-arm64
make pack-linux
- name: Install MSYS2 and 'mingw-w64-i686-toolchain'
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
cache: true
install: mingw-w64-i686-toolchain
update: true

- name: Build for Windows
if: matrix.os == 'windows-latest'
shell: bash
run: |
$RUNNER_TEMP/msys64/msys2_shell.cmd -defterm -no-start -mingw32 -lc "mingw32-make compile-windows-x86"
make compile-windows
make pack-windows
Expand Down
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,23 @@ compile-windows:
gcc -O3 $(WINDO_FLAGS) src/sqlite3-vsv.c src/vsv/*.c -o dist/vsv.dll -lm
gcc -O1 $(WINDO_FLAGS) -include src/regexp/constants.h src/sqlite3-sqlean.c src/crypto/*.c src/define/*.c src/fileio/*.c src/fuzzy/*.c src/math/*.c src/regexp/*.c src/regexp/pcre2/*.c src/stats/*.c src/text/*.c src/unicode/*.c src/uuid/*.c src/vsv/*.c -o dist/sqlean.dll -lm

compile-windows-x86:
mkdir -p dist/x86
gcc -O1 $(WINDO_FLAGS) src/sqlite3-crypto.c src/crypto/*.c -o dist/x86/crypto.dll
gcc -O3 $(WINDO_FLAGS) src/sqlite3-define.c src/define/*.c -o dist/x86/define.dll
gcc -O3 $(WINDO_FLAGS) src/sqlite3-fileio.c src/fileio/*.c -o dist/x86/fileio.dll
gcc -O1 $(WINDO_FLAGS) src/sqlite3-fuzzy.c src/fuzzy/*.c -o dist/x86/fuzzy.dll
gcc -O3 $(WINDO_FLAGS) src/sqlite3-math.c src/math/*.c -o dist/x86/math.dll -lm
gcc -O3 $(WINDO_FLAGS) src/sqlite3-regexp.c -include src/regexp/constants.h src/regexp/*.c src/regexp/pcre2/*.c -o dist/x86/regexp.dll
gcc -O3 $(WINDO_FLAGS) src/sqlite3-stats.c src/stats/*.c -o dist/x86/stats.dll -lm
gcc -O3 $(WINDO_FLAGS) src/sqlite3-text.c src/text/*.c -o dist/x86/text.dll
gcc -O3 $(WINDO_FLAGS) src/sqlite3-unicode.c src/unicode/*.c -o dist/x86/unicode.dll
gcc -O3 $(WINDO_FLAGS) src/sqlite3-uuid.c src/uuid/*.c -o dist/x86/uuid.dll
gcc -O3 $(WINDO_FLAGS) src/sqlite3-vsv.c src/vsv/*.c -o dist/x86/vsv.dll -lm
gcc -O1 $(WINDO_FLAGS) -include src/regexp/constants.h src/sqlite3-sqlean.c src/crypto/*.c src/define/*.c src/fileio/*.c src/fuzzy/*.c src/math/*.c src/regexp/*.c src/regexp/pcre2/*.c src/stats/*.c src/text/*.c src/unicode/*.c src/uuid/*.c src/vsv/*.c -o dist/x86/sqlean.dll -lm

pack-windows:
7z a -tzip dist/sqlean-win-x86.zip ./dist/x86/*.dll
7z a -tzip dist/sqlean-win-x64.zip ./dist/*.dll

compile-macos:
Expand Down

0 comments on commit c896e04

Please sign in to comment.